# Am I using FindMinimum correctly?

This is the first time I try to use FindMinimum. Am I using it correctly? Before that,

is it always possible to use FindMinimum or Minimize?

Here my code:

f[q_?NumberQ, a_?NumberQ, b_?NumberQ]:=NIntegrate[ (Sin[x]^2 Exp[-q^2 Sin[x]^2 Cos[y]^2])/((a ^2 Cos[y]^2 +
b ^2 Sin[y]^2) Sin[x]^2 + a^2 b^2 Cos[x]^2), {x, 0, Pi}, {y,0, Pi/2}]

FindMinimum[f[q, a, b], {q}, {a}, {b}]

{0., {q -> 114451., a -> 95702.8, b -> 134094.}}


I think this was very easy. Is it just that?

• I see no problem. If you need verification you may plot the nearby region and visually confirm the minimum. – Giovanni Baez Jun 29 '18 at 18:03
• Suppose this function is the total energy of a physical system. So, $a$, $b$ and $q$ are the variational parameters that minimize the energy? – Dinesh Shankar Jun 29 '18 at 18:08
• There are definitely systems that Minimize and FindMinimum will have trouble with, but I see no reason to believe that this would be one of them: it looks like the composition of a bunch of smooth functions, so it shouldn't be too hard on it. Generally I assume that numerical minimizers are going to be more robust than root finders, since the problem being solved is relaxed one step. Note that FindMinimum only attempts to find a local minima though. – eyorble Jun 29 '18 at 18:11
• I'd personally would look at the region, Its hard to find a minimum without a good idea were it is. You might have found a local minima, but starting the search in another region leads to another answer. – Giovanni Baez Jun 29 '18 at 18:11
• Hum. I got it. Thank you.. – Dinesh Shankar Jun 29 '18 at 18:15