function  [lambda2, df]=lambda2(v)    
%return integral as first argument
lambda2=quad(@g2,v,5);
%return derivative of the integral, i.e. the function itself as the second
%argument
df=lambda2(v);
end