Well, in this case, let's look at your expression's antiderivative (Sage is known to have some infelicities in definite integration). Sage's default integrator (i. e. maxima
) needs to know if c2−1>0 ; account for that as well as for other Sage's integrators :
(c,t)=var("c, t")
E=sqrt(1-t^2)*(t+c)
Sols={}
with assuming(c>-1,c<1):Sols.update({"Mn":E.integrate(t)})
with assuming(c<-1):Sols.update({"Mp":E.integrate(t)})
Sols.update({"Mf":E.integrate(t, algorithm="fricas")})
Sols.update({"Mg":E.integrate(t, algorithm="giac")})
Sols.update({"Mm":mathematica.Integrate(E,t).sage()}
Sols.update({"Ms":E.integrate(t, algorithm="sympy")}))
We have now six expressions (four pairwise distinct expressions) for a primitive of your expression E:
Sols
{'Mn': 1/2*sqrt(-t^2 + 1)*c*t + 1/2*c*arcsin(t) - 1/3*(-t^2 + 1)^(3/2),
'Mp': 1/2*sqrt(-t^2 + 1)*c*t + 1/2*c*arcsin(t) - 1/3*(-t^2 + 1)^(3/2),
'Mf': 1/6*(3*c*t^5 + 2*t^6 - 15*c*t^3 - 12*t^4 + 12*c*t + 12*t^2 - 6*(3*c*t^2 - (c*t^2 - 4*c)*sqrt(-t^2 + 1) - 4*c)*arctan((sqrt(-t^2 + 1) - 1)/t) + 3*(3*c*t^3 + 2*t^4 - 4*c*t - 4*t^2)*sqrt(-t^2 + 1))/(3*t^2 - (t^2 - 4)*sqrt(-t^2 + 1) - 4),
'Mg': 1/2*c*arcsin(t) + 1/6*((3*c + 2*t)*t - 2)*sqrt(-t^2 + 1),
'Mm': 1/2*c*arcsin(t) + 1/6*(3*c*t + 2*t^2 - 2)*sqrt(-t^2 + 1),
'Ms': 1/2*sqrt(-t^2 + 1)*c*t + 1/3*sqrt(-t^2 + 1)*t^2 + 1/2*c*arcsin(t) - 1/3*sqrt(-t^2 + 1)}
More easily seen and understood via \LaTeX
:
Mn:12√−t2+1ct+12carcsin(t)−13(−t2+1)32Mp:12√−t2+1ct+12carcsin(t)−13(−t2+1)32Mf:3ct5+2t6−15ct3−12t4+12ct+12t2−6(3ct2−(ct2−4c)√−t2+1−4c)arctan(√−t2+1−1t)+3(3ct3+2t4−4ct−4t2)√−t2+16(3t2−(t2−4)√−t2+1−4)Mg:12carcsin(t)+16((3c+2t)t−2)√−t2+1Mm:12carcsin(t)+16(3ct+2t2−2)√−t2+1Ms:12√−t2+1ct+13√−t2+1t2+12carcsin(t)−13√−t2+1
(one can ensure that maxima
's solution for c>1 is identical to the one found for c<−1:
with assuming(c>1): bool(E.integrate(t)==Sols.get("Mp"))
True).
But all these expressions turn out to derivate to E:
[(Sols.get(u).diff(t)/E).canonicalize_radical() for u in Sols.keys()]
[1, 1, 1, 1, 1, 1]
Different integrators have different strategies for integration, leading to different primitives. Barring discontinuities, these four expressions should differ by a constant.
What do you assume about c? Try making it explicit, using
assume
beforeintegrate
.Homework ?
Works for me using Sage 8.9.beta3 using Python3.
rburning
's hint is good, but trying other integrators ("sympy", "giac", "mathematica_free") might give you other ideas... Check your results by rederiving...@rburing c is any value in the interval [-0.9, 0.9], which i plan to vary later at the end after the integration and differentiation.
@emmanuel definitely not homework but research paper that I am leading at the moment. my co-author got different results than mine. so we thought of using Sage to verify the results.