Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As said in comment, the problem is that Maxima introduces a arbitrary constant %k1 and asks the user an hypothesis about it :

sage: G,M=var("G,M")
sage: y=function("y")
sage: with assuming(G>0, M>0): Sol=desolve(de, y(x), ivar=x)

[ Snip.. ]

TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(%k1>0)', see `assume?` for more details)
Is %k1 positive or negative?

The workaround to this problem is to add this assumption to what Maxima uses. This leads to another problem : there's no way to define a variable whose Maxima name would be %k1. The workaround is to ruin this directly in Sage's default Maxima interpreter :

sage: maxima_calculus("assume(%k1>0);")
[%k1>0]
sage: with assuming(G>0, M>0): Sp=desolve(de, y(x), ivar=x)
sage: maxima_calculus("forget(%k1>0);")
[%k1>0]
sage: maxima_calculus("assume(%k1<0);")
[%k1<0]
sage: with assuming(G>0, M>0): Sn=desolve(de, y(x), ivar=x)

One gets implicit answers, woese getting explicit solutions is ... problematic :

sage: Sp+Sn
[1/2*sqrt(2)*(G*M*arctan(sqrt(-(G*M*_K1*y(x) - G*M)/y(x))/sqrt(G*M*_K1)) + sqrt(G*M*_K1)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x))*y(x))/(sqrt(G*M*_K1)*G*M*_K1) == _K2 + x,
 -1/2*sqrt(2)*(G*M*arctan(sqrt(-(G*M*_K1*y(x) - G*M)/y(x))/sqrt(G*M*_K1)) + sqrt(G*M*_K1)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x))*y(x))/(sqrt(G*M*_K1)*G*M*_K1) == _K2 + x,
 1/4*sqrt(2)*(G*M*log(-(sqrt(2)*sqrt(-G*M*_K1) - sqrt(2)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x)))/(sqrt(2)*sqrt(-G*M*_K1) + sqrt(2)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x)))) + 2*sqrt(-G*M*_K1)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x))*y(x))/(sqrt(-G*M*_K1)*G*M*_K1) == _K2 + x,
 -1/4*sqrt(2)*(G*M*log(-(sqrt(2)*sqrt(-G*M*_K1) - sqrt(2)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x)))/(sqrt(2)*sqrt(-G*M*_K1) + sqrt(2)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x)))) + 2*sqrt(-G*M*_K1)*sqrt(-(G*M*_K1*y(x) - G*M)/y(x))*y(x))/(sqrt(-G*M*_K1)*G*M*_K1) == _K2 + x]

More readably :

2(GMarctan(GMK1y(x)GMy(x)GMK1)+GMK1GMK1y(x)GMy(x)y(x))2GMK1GMK1=K2+x

2(GMarctan(GMK1y(x)GMy(x)GMK1)+GMK1GMK1y(x)GMy(x)y(x))2GMK1GMK1=K2+x

2(GMlog(2GMK12GMK1y(x)GMy(x)2GMK1+2GMK1y(x)GMy(x))+2GMK1GMK1y(x)GMy(x)y(x))4GMK1GMK1=K2+x

2(GMlog(2GMK12GMK1y(x)GMy(x)2GMK1+2GMK1y(x)GMy(x))+2GMK1GMK1y(x)GMy(x)y(x))4GMK1GMK1=K2+x

Neither Sympy nor Fricas can solve thos ODE ; Mathematica also returns an implicit solution :

sage: mathematica("DSolve[-y''[x]-G*M/y[x]^2==0, y[x], x]")
Solve[
 (-((G*M*Log[G*M + C[1]*y[x] + Sqrt[C[1]]*Sqrt[C[1] + (2*G*M)/y[x]]*y[x]])/
      C[1]^(3/2)) + (Sqrt[C[1] + (2*G*M)/y[x]]*y[x])/C[1])^2 == (x + C[2])^2, 
 y[x]]

i. e., more readibly :

Solve[(y(x)c1+2GMy(x)c1GMlog(c1y(x)c1+2GMy(x)+c1y(x)+GM)c3/21)2=(c2+x)2,y(x)]

Note : since your ODE is of the second order, you need two boundary conditions uin order to determine your solution ; your ics gives only one...