Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9623 > unrolled thread

Integrating an InterpolatingFunction times another function

Started byAndrew DeYoung <adeyoung@andrew.cmu.edu>
First post2012-04-13 09:04 +0000
Last post2012-04-14 07:16 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Integrating an InterpolatingFunction times another function Andrew DeYoung <adeyoung@andrew.cmu.edu> - 2012-04-13 09:04 +0000
    Re: Integrating an InterpolatingFunction times another function Yi Wang <tririverwangyi@gmail.com> - 2012-04-14 07:09 +0000
    Re: Integrating an InterpolatingFunction times another function A Retey <awnl@gmx-topmail.de> - 2012-04-14 07:16 +0000

#9623 — Integrating an InterpolatingFunction times another function

FromAndrew DeYoung <adeyoung@andrew.cmu.edu>
Date2012-04-13 09:04 +0000
SubjectIntegrating an InterpolatingFunction times another function
Message-ID<jm8q6r$j74$1@smc.vnet.net>
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

[toc] | [next] | [standalone]


#9632

FromYi Wang <tririverwangyi@gmail.com>
Date2012-04-14 07:09 +0000
Message-ID<jmb7ra$r0i$1@smc.vnet.net>
In reply to#9623
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

[toc] | [prev] | [next] | [standalone]


#9645

FromA Retey <awnl@gmx-topmail.de>
Date2012-04-14 07:16 +0000
Message-ID<jmb87o$r6e$1@smc.vnet.net>
In reply to#9623
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?

Use NIntegrate. It's probably worth noting that it is a very special 
feature that integration of just interpolating functions works 
symbolically, you can even get another interpolating function for the 
indefinite integral, e.g.:

Integrate[ifun[x],x]


hth,

albert

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web