Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2578 by peterjef...@gmail.com: integrate(sqrt(2+2*sin(x)), x)
does not evaluate
http://code.google.com/p/sympy/issues/detail?id=2578
I'm not sure if this is the right place for this, but I couldn't find a
user story area on the main page. I'm using the latest version of sympy
from git and python 2.6. I was trying to do the following integral:
In [8]: integrate(sqrt(2+2*sin(x)), x)
Out[8]:
⌠
⎮ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
⎮ ╲╱ 2⋅sin(x) + 2 dx
⌡
I worked out the solution by hand
step 1: multiply by conjugate sqrt(2-2*sin(x))
step 2: trig substitution 4*cos(x)**2 = 4 - 4*sin(x)**2
step 3: u-substituiton u = 2 - 2*sin(x) du = -2*cos(x) dx
Answer: -2*sqrt(2-2*sin(x))
and then did the individual integrations to see where it was getting stuck:
In [7]: integrate(sqrt(2+2*sin(x))*sqrt(2-2*sin(x))/sqrt(2-2*sin(x)), x)
Out[7]:
⌠
⎮ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
⎮ ╲╱ 2⋅sin(x) + 2 dx
⌡
multiplying by the conjugate is not done automatically and when added
manually simplified before it can help at all. It seems like that would be
a difficult strategy to implement, but it would be pretty cool if there was
a way to do it without slowing everything down to much.
In [10]: integrate(sqrt(4+4*sin(x)**2)/sqrt(2-2*sin(x)), x)
In [11]: integrate(2*sqrt(1-sin(x)**2)/sqrt(2-2*sin(x)), x)
...these seemed to go into a loop longer than 30 seconds so I killed them
with ^C
In [12]: integrate(2*sqrt(cos(x)**2)/sqrt(2-2*sin(x)), x)
Out[12]:
⎽⎽⎽⎽⎽⎽⎽⎽⎽
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽ ╱ 2
-2⋅╲╱ -2⋅sin(x) + 2 ⋅╲╱ cos (x)
─────────────────────────────────
cos(x)
worked but the simplification strategy ended before the step canceling
cos(x)
In [14]: integrate(2*cos(x)/sqrt(2-2*sin(x)), x)
Out[14]:
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
-2⋅╲╱ -2⋅sin(x) + 2
this answer matches what I got by hand, but I didn't verify it with maxima
(sage) or wolfram alpha because they could not evaluate/ did not evaluate
to a sane function.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.