Symbolic Integration
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everybody,
I have a little question about 'int' function. I have this code:
>> syms x y
>> int(x+y,x)
so I want to know why is this the result?:
ans =
(x + y)^2/2
instead of:
x^2/2+x*y
I'm a little confused about it, I hope you can help me understand.
0 Kommentare
Akzeptierte Antwort
Teja Muppirala
am 12 Mär. 2011
Both answers are correct.
d/dx[ (x+y)^2/2 ] = d/dx[ x^2/2 + x*y + y^2/2 ] = x + y
d/dx[ x^2/2 + x*y ] = x + y
The ambiguity lies in the constant of integration. In the first case the constant of integration ends up being y^2/2.
If you really want to enforce that the constant of integration is zero then do:
F = int(x+y,x,0,x)
expand(F)
Weitere Antworten (1)
Walter Roberson
am 12 Mär. 2011
Odd, I don't get that in Maple; unfortunately I don't have the Symbolic Toolbox to test with.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!