Message Boards Message Boards

0
|
4682 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Numerically integrate a function whose lower limit depends on a parameter?

Posted 6 years ago

I have a function f(r) that I want to integrate numerically. The code is NIntegrate[f[r], {r, lowerlimit[r], Infinity}] . The lower limit is given by lowerlimit=c if r<=100 and lowerlimit=2*r otherwise, note that r can not be negative and c is some positive number. I wonder how to implement this integral.

POSTED BY: mohamed alzenad
5 Replies

This doesn't make any sense. You appear to be using the name r to refer to the variable of integration as well as an independent parameter. Please be clearer.

POSTED BY: John Doty

I attached a picture of the problem to make it clearer

POSTED BY: mohamed alzenad

Thank you John. I attached a picture of the problem to make it clearer

POSTED BY: mohamed alzenad

On your paper, you have x as the variable of integration, which makes sense. Do that in your code. Define your function lowerlimit using Piecewise, Condition, or even If. Then your expression will, given a value for r, yield a result.

POSTED BY: John Doty

Thank you John, this was so helpful

POSTED BY: mohamed alzenad
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract