Re: Integrating an InterpolatingFunction times another function
- To: mathgroup at smc.vnet.net
- Subject: [mg126057] Re: Integrating an InterpolatingFunction times another function
- From: Yi Wang <tririverwangyi at gmail.com>
- Date: Sat, 14 Apr 2012 03:08:45 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jm8q6r$j74$1@smc.vnet.net>
Hi, Andrew,
I guess Interpolation is more useful numerically. If you want a result, try
NIntegrate[x*ifun[x], {x, 1, 5}]
On the other hand, if you want an exact result:
ifun2 = InterpolatingPolynomial[points, x]
Integrate[x*ifun2, {x, 1, 5}]
On Friday, April 13, 2012 5:04:27 AM UTC-4, Andrew DeYoung wrote:
> Hi,
>
> I have made a sample InterpolatingFunction:
>
> points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
> ifun = Interpolation[points]
>
> The following integral computes fine:
>
> Integrate[ifun[x], {x, 1, 5}]
>
> However, this integral will not be evaluated:
>
> Integrate[x*ifun[x], {x, 1, 5}]
>
> Why will this integral not be computed? Is there any way that I can
> compute this integral?
>
> Thank you kindly!
>
> Andrew DeYoung
> Carnegie Mellon University