Incorrect integral calculation in MuPAD
1 回表示 (過去 30 日間)
古いコメントを表示
Integration of function x-1 wrt x using command int(x-1,x) in MuPAD gives answer as (x-1)^2/2 instead of x^2/2-x. Can anybody explain why?
Thanks in advance.
Regards Nishant
0 件のコメント
回答 (1 件)
Walter Roberson
2015 年 12 月 22 日
The difference between the two is 1/2 which is a constant and so falls into the usual "plus an arbitrary constant" category. If you diff((x-1)^2/2,x) you get x-1, so you cannot say that the result is incorrect.
2 件のコメント
Walter Roberson
2015 年 12 月 23 日
x^2/2 - x might be more conventional but remember that the indefinite integral is really x^2/2 - x + a constant, so any result of the form x^2/2 - x + a particular constant + an implied constant is mathematically correct
It does look unusual, but the mathematics of it is sound.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!