Integration function generates different result by a same expression
显示 更早的评论
A same expression in two style will be integrated in two different results, why ? and which result is correct ?
syms a b c x
y1=a*x+1+a*(b-c);
y2=1+a*(x+b-c);
>> int(y1)
ans =
(a*x^2)/2 + (a*(b - c) + 1)*x
>> int(y2)
ans =
x + (a*(b - c + x)^2)/2
and obviously they are not equal.
>> expand(int(y1))-expand(int(y2))
ans =
a*b*c - (a*c^2)/2 - (a*b^2)/2
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!