Request of calculating mixed integral - from -Inf to k

1 回表示 (過去 30 日間)
mortain
mortain 2012 年 1 月 12 日
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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by