Request of calculating mixed integral - from -Inf to k

1 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2012-1-12
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 个评论
Walter Roberson
Walter Roberson 2012-1-12
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
mortain Antonio 2012-1-13
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by