I have a routine which repeatedly calls FindMaximum to find the local maxima of f[m,a,b,c] as a function of m only (i.e. considers a,b,c as fixed and then finds the values of m for which the function is a local max).
I know that the FindMaximum algorithm uses Derivative[1,0,0,0][f]. Does this mean that Mathematica will recalculate the derivative every time FindMaximum is called? If so,
- Is there any way to avoid this (e.g. define explicitly a function equal to Derivative[1,0,0,0][f][m,a,b,c] and get Mathematica to use this function rather than calculating the derivative every time)?
- If (1.) is feasible, given that I expect a run of the routine to call FindMaximum several thousand times, would it represent a significant time saving?
If it helps, the function is
f[m_,a_,b_,c_]:=(Exp[a(m-b)]+1)^(-1) - c(2+m)/3 + c ((1-m^2)/3)^(1/2)
and the routine calls FindMaximum twice for each value of the parameters a,b,c (starting at m=0.9 and m=-0.9 respectively).