Request of calculating mixed integral - from -Inf to k
1 view (last 30 days)
Show older comments
Hello,
I have a simple question, but i cannot solve it. I would like to evaluate the integral of the function:
f=exp(-x) between -Inf and k.
I tried to use quad and int, but I haven't succedded both because of the -Inf and the k.
Please, let me know how to tackle such a problem, knowing that k is a symbol.
Kind regards, Antonio
0 Comments
Accepted Answer
Walter Roberson
on 12 Jan 2012
If k is a symbol, you will have to use the symbolic toolbox.
syms x k
int(exp(-x), x, -inf, k)
Hint: the answer is infinity unless k is -infinity
3 Comments
Walter Roberson
on 12 Jan 2012
At -inf, you have exp(-(-inf)) which is exp(inf) which is inf. Unless somewhere along the line you subtract off infinity, you are going to get infinity as your answer.
The indefinite integral of exp(-x) is -exp(-x) + C . You could let your C be 1 arbitrarily, giving you 1-exp(-x) like you were expecting. But apply that to the lower bound x = -inf and you get 1-exp(-(-inf)) there, which simplifies to 1-exp(inf); and then remember you are _subtracting_ that from whatever the upper bound is, so that -exp(inf) is going to switch to +exp(inf) which is +inf.
mortain Antonio
on 13 Jan 2012
Dear Walter,
your explanation is precise and I feel stupid. Lot of time using software and forgot the use of pen and the basic math!
I guess, the paper has a mistake, in fact it shouldn't be -Inf but 0. Reading better the paper, the lower values of the integral was depending on the domain of the variable.
Thanks again for the matlab and maths lessons!
Cheers,
Antonio
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!