Symbolic Toolbox: integration

>> int('cos(x^2)^2')
Warning: Explicit integral could not be found.
ans =
int(cos(x^2)^2, x)
>> int('cos(2*x^2)')
ans =
(pi^(1/2)*fresnelC((2*x)/pi^(1/2)))/2
But there is a formula cos(2y)=2cos(y)^2)-1 and in first case MATLAB can't solve..
May be MuPAD forced to solve?

댓글 수: 9

Walter Roberson
Walter Roberson 2011년 12월 12일
It works in Maple.
Walter Roberson
Walter Roberson 2011년 12월 13일
You could _try_
int(simple('cos(x^2)^2'),'x')
Andrei Bobrov
Andrei Bobrov 2011년 12월 13일
Hi Walter! Small typo:
int(simplify('cos(x^2)^2'),'x')
Walter Roberson
Walter Roberson 2011년 12월 13일
No, simple() is correct rather than simplify() . simple() goes through a variety of conversions to find the "best" one, telling you along the way what it is doing.
Andrei Bobrov
Andrei Bobrov 2011년 12월 13일
in "my" MATLAB with Maple Toolbox
http://imageshack.us/photo/my-images/838/symint.png/
Andrei Bobrov
Andrei Bobrov 2011년 12월 13일
in "my" MATLAB with MuPAD (I use MATLAB 7.10)
http://imageshack.us/photo/my-images/542/symint2.png/
Walter Roberson
Walter Roberson 2011년 12월 13일
int(simple(sym('cos(x^2)^2')),'x')
Andrei Bobrov
Andrei Bobrov 2011년 12월 13일
I'm agree , Walter!
(Maple Toolbox)
http://imageshack.us/photo/my-images/843/symint3.png/
Andrei Bobrov
Andrei Bobrov 2011년 12월 13일
Last comment :)
http://imageshack.us/photo/my-images/402/symint4.png/
(for Maple Toolbox)

댓글을 달려면 로그인하십시오.

 채택된 답변

bym
bym 2011년 12월 14일

0 개 추천

Apparently you have to do the substitution manually
int(simple(cos(x^2)^2))
Warning: Explicit integral could not be found.
Using the sincos version returned by
simple(cos(x^2)^2)
yields this
int(cos(2*x^2)/2 + 1/2)
ans =
x/2 + (pi^(1/2)*fresnelC((2*x)/pi^(1/2)))/4
I could not find where the sincos 'simplification' is available outside the simple command as it is in Maple...maybe this is the reason Maple returns the result automagically ;)
[edit for completeness]
int(feval(symengine, 'combine', cos(x^2)^2, 'sincos'))
ans =
x/2 + (pi^(1/2)*fresnelC((2*x)/pi^(1/2)))/4

댓글 수: 4

Walter Roberson
Walter Roberson 2011년 12월 14일
http://www.mathworks.com/help/toolbox/mupad/stdlib/combine.html
combine(cos(x^2)^2,sincos)
Note that this is at the MuPAD level, not the MATLAB level, so you may need to use feval() or similar to access it
feval(symengine, 'combine', cos(x^2)^2, 'sincos')
bym
bym 2011년 12월 14일
works well, my local documentation does not turn up an obvious help topic when searching for 'combine'
feval(symengine, 'combine', cos(x^2)^2, 'sincos')
ans =
cos(2*x^2)/2 + 1/2
thanks Walter
Igor
Igor 2011년 12월 14일
Yes, yes...
good construction with "combine"/"sincos"
But from the technical calculation point of view (as semi-analitical and fast integration is needed)
it's not good to think about integration procedure details...
And if more complex integral occures??
To ask own intuition?
Walter Roberson
Walter Roberson 2011년 12월 14일
Humans are better at seeing patterns or understanding context than machines are. It is *often* the case that a human will have to apply knowledge of theoretical equivalences in order to make progress in integration.
MuPAD is not as strong as some of the other products around, but _all_ of them are missing a lot of patterns.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2011년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by