Re: FindRoot and NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg81914] Re: FindRoot and NIntegrate
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Sat, 6 Oct 2007 04:45:31 -0400 (EDT)
- References: <fe4tfg$5h$1@smc.vnet.net>
Hi,
beside the messages for the slow convergence
f[x_?NumericQ] := NIntegrate[Sin[y - x], {y, -Pi/2, Pi/2}]
FindRoot[f[x], {x, 0.1}]
work fine and find x->2.8*10^-17 and thats pretty close
to 0
Regards
Jens
mfedert at gmail.com wrote:
> Hi all,
>
> I have what is probably a very simple problem. I want to find x which
> solves an equation of the form
>
> \integral f(x,y) dy = 0
>
> I have tried something along the lines of
>
> FindRoot[ NIntegrate[ f(x,y) , {y, -inf, inf} ], {x, x_0 } ]
>
> but it doesn't work ---- my theory being that NIntegrate tries to go
> ahead and do the numerical integration before it knows what x is equal
> to... which blows up because the integrand is - as a function of x -
> non-numerical... Is there a way around this? I'm sure there's some
> trivial modification I can make to get things working again.
>
> Thanks, in anticipation ---
> MF
>
>