Re: How to evaluate a NIntegrate expression properly

• To: mathgroup at smc.vnet.net
• Subject: [mg39722] Re: How to evaluate a NIntegrate expression properly
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Mon, 3 Mar 2003 23:49:11 -0500 (EST)
• Organization: Universitaet Leipzig
• References: <b3v6uf\$k41\$1@smc.vnet.net>
• Reply-to: kuska at informatik.uni-leipzig.de
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

f[y_] := Integrate[y^2*x^2, {x, 0, 3}]
NSolve[Evaluate[f[y] == 20], y]

or

f[y_?NumericQ] := NIntegrate[y^2*x^2, {x, 0, 3}]
FindRoot[f[y] == 20, {y, 0, 20}]

Regards
Jens

Yong Xiao wrote:
>
> Hi,
> I have a problem regarding to how to use NIntegrate and NSolve together.
> A sampe is as follwing:
>
> f[y_] := NIntegrate[y^2*x^2, {x, 0, 3}]
> NSolve[f[y] == 20, y]
>
> Complaint:
> \!\(NIntegrate::"inum" \(\(:\)\(\ \)\) "Integrand \!\(2.25`  \\\\  y\^2\)
> is
>     not numerical at \!\({x}\) = {1.5`}."\)
>
> Thanks in advance.
>
> X.Y.

```

• Prev by Date: Re: Caching of values and delayed sets
• Next by Date: Re: Is it doable in Mathematica? How?
• Previous by thread: Re: How to evaluate a NIntegrate expression properly
• Next by thread: Re: How to evaluate a NIntegrate expression properly