I need to find the minimum of a function $f(t) = \int_0^1\!g(t,x)\,dx$. What I did in mathematica is as follows:
f[t_] = NIntegrate[g[t,x],{x,-1,1}]
FindMinimum[f[t],{t,t0}]
However mathematica halts at the first try, because NIntegrate does not work with the symbolic t. Although Plot[f[t],{t,0,1}] works perferctly, FindMinimum stops at the initial point.
Any way to get around it? Thanks!