Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your first code snippet, whatever it means, WorksForMe(TM) in 9.3.beta1 :

sage: %cpaste
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:#solExt_0(y)=(((R^2-y^2)*asin(x/(sqrt(R-y)*sqrt(y+R)))+x*sqrt((-y^2)-x^2+R^2))/2 ).subs(x==-sqrt(2*R*y - 2*y^2))
:#solExt_1(y)=(((R^2-y^2)*asin(x/(sqrt(R-y)*sqrt(y+R)))+x*sqrt((-y^2)-x^2+R^2))/2 ).subs(x==sqrt(2*R*y - 2*y^2))
:#solExt=solExt_1-solExt_0
:#show('must give : ',solExt )
:var('x,y,R,T',domain='real')
:Rnum=1
:numL=[R==Rnum]
:assume(T>0)
:assume(T<=R)
:#assume((y-R)*(y+R)<=0)
:Iz=sqrt(R^2-y^2 - x^2)
:
:xLow=-sqrt(2*R*y - 2*y^2)
:xUp=sqrt(2*R*y - 2*y^2)
:show(LatexExpr(r"\int_{"+"}^{"+"} "+latex(Iz))+"dx")
:IxT=integrate(Iz(x),x,xLow,xUp)
:--
(x, y, R, T)
\newcommand{\Bold}[1]{\mathbf{#1}}\int_{}^{} \sqrt{R^{2} - x^{2} - y^{2}} dx
sage: IxT
2*sqrt(2*R*y - 2*y^2)*sqrt(-y^2)

Suggestion : try algorithm="giac" or algorithm="fricas" to see other possible primitives...

I'm afraid that your second code snippet does something different:

sage: %cpaste
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:var('x,y,R,T',domain='real')
:Rnum=1
:numL=[R==Rnum]
:assume(T>0)
:
:assume(T<=R)
:Iz(x)=sqrt(T - x^2)
:xLow=-sqrt(2*R*y - 2*y^2)
:xUp=sqrt(2*R*y - 2*y^2)
:IxT=integrate(Iz(x),x)
:
:
:Ix=(IxT.subs(T==R^2-y^2))
:show(LatexExpr(r"\int_{"+latex(xLow)+"}^{"+latex(xUp)+"} "+latex(Iz.subs(T==R^2-y^2))+" = "+latex(Ix)))
:--
(x, y, R, T)
\newcommand{\Bold}[1]{\mathbf{#1}}\int_{ -\sqrt{2 \, R y - 2 \, y^{2}} }^{ \sqrt{2 \, R y - 2 \, y^{2}} } x \ {\mapsto}\ \sqrt{R^{2} - x^{2} - y^{2}} = \frac{1}{2} \, {\left(R^{2} - y^{2}\right)} \arcsin\left(\frac{x}{\sqrt{R^{2} - y^{2}}}\right) + \frac{1}{2} \, \sqrt{R^{2} - x^{2} - y^{2}} x
sage: IxT
1/2*T*arcsin(x/sqrt(T)) + 1/2*sqrt(-x^2 + T)*x
sage: integrate(Iz(x),x, algorithm="giac")
1/2*T*arcsin(x/sqrt(T)) + 1/2*sqrt(-x^2 + T)*x
sage: integrate(Iz(x),x, algorithm="fricas")
-1/2*T*arctan(sqrt(-x^2 + T)/x) + 1/2*sqrt(-x^2 + T)*x
sage: integrate(Iz(x),x, algorithm="sympy")
cases(((x^2/T > 1, 1/2*I*x^3/(sqrt(T)*sqrt(x^2/T - 1)) - 1/2*I*T*arccosh(x/sqrt(T)) - 1/2*I*sqrt(T)*x/sqrt(x^2/T - 1)), (1, 1/2*sqrt(T)*x*sqrt(-x^2/T + 1) + 1/2*T*arcsin(x/sqrt(T)))))