NIntegrate::inumr
Examples
Basic Examples (2)
An error occurs because the integrand contains a parameter that does not have a numerical value:
The integral is computed without difficulty if the parameter has a numerical value:
Here, NIntegrate is used within NMaximize and is evaluated repeatedly without a numerical value for c:
One possible solution is to use Integrate instead of NIntegrate. This is advantageous because NMaximize can do symbolic processing on its input:
If symbolic integration is not possible, an alternative is to restrict the argument type given to NIntegrate with NumericQ by writing a helper function fun:
Symbolic input returns unevaluated:
Now, using NMaximize on fun evaluates without any warnings: