I am trying to solve for a variable which appears in the limits of an integral, rather like in the following;
Clear[f, a, x] f[a_] := Integrate[x^2 + a x, {x, 0, a }] f[Power[6, (3)^-1]] NSolve[5 == f[a], a, Reals] This works absolutely fine. But the integral I really care about is a mess, and so has, of course, no nice closed form. So I try the following;
Clear[f, a, x] f[a_] := NIntegrate[x^2 + a x, {x, 0, a }] f[Power[6, (3)^-1]] NSolve[5 == f[a], a, Reals] and this does not work. Instead I get NIntegrate::nlim: x = a is not a valid limit of integration. In both of these examples, the third line evaluates the function f[a] fine. I also tried
f[a_?NumericQ] := NIntegrate[x^2 + a x, {x, 0, a }] which fails with NSolve::nsmet: This system cannot be solved with the methods available to NSolve.
I rather hoped the link below would answer my problem, but of course it refers to Integrate, not NIntegrate.
I'd be very grateful for any suggestions.