Wrong solution/output for differential equation

asked 2019-01-14 17:54:14 +0200

Thrash gravatar image

updated 2019-01-14 17:56:27 +0200

As the user rburing advised in the thread https://ask.sagemath.org/question/449... I'm opening this one now.

When running the following code, one obtains a wrong output:

y=function('y')(x)
desolve(diff(y)==4*y/x+x*sqrt(y),y,ics=[1,1]).factor()

The output is 1/4*x^4*(log(x) - 2)^2 instead of 1/4*x^4*(log(x) + 2)^2. Mathematica however outputs both (by running DSolve[{D[y[x], x] == 4*y[x]/x + x*Sqrt[y[x]], y[1] == 1}, y[x], x]).

edit retag flag offensive close merge delete

Comments

1
  1. The problem is specific to maxima :

    • sympy has another, distinct, failure.

    • fricas fails entirely.

    • giac gives an acceptable answer.

  2. You should follow the steps suggested in the documentation, possibly also reporting this bug against maxima.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2019-01-15 08:42:01 +0200 )edit

How do you "access" those answers? For example, desolve(diff(y)==4*y/x+x*sqrt(y),y,ics=[1,1],algorithm="giac") gives ValueError: unknown algorithm giac.

Thrash gravatar imageThrash ( 2019-01-15 21:54:02 +0200 )edit
1

giac("desolve([y'=4*y/x+x*sqrt(y),y(1)=1],y)").sage() should give you [1/4*(ln(x) + 2)^2*e^(4*ln(x))].

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2019-01-16 09:16:32 +0200 )edit