Re: FindRoot and parameters in NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg124518] Re: FindRoot and parameters in NIntegrate
- From: danl at wolfram.com
- Date: Sun, 22 Jan 2012 07:25:21 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jfe3jq$a16$1@smc.vnet.net>
- Reply-to: comp.soft-sys.math.mathematica at googlegroups.com
(1) Only let the NIntegrate work when parameters have numeric values. (2) Specify a finite AccuracyGoal so as to avoid messages about trouble with the result and error estimates. In[272]:= integ[a_?NumericQ, b_?NumericQ] := NIntegrate[a + b x, {x, 0, 1}, AccuracyGoal -> 10] In[273]:= FindRoot[{1 + a + b, integ[a, b]}, {{a, 0}, {b, 0}}] Out[273]= {a -> 1., b -> -2.} Daniel Lichtblau Wolfram Research