Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What version of Sage do you use ? With 10.1.beta8, the substitution is unproblematic. I changed notations a bit :

sage: reset()
sage: y=function("y")
sage: Eq=x^2+y(x)^2-1 ; Eq
x^2 + y(x)^2 - 1
sage: S1=Eq.diff(x).solve(diff(y(x))) ; S1
[diff(y(x), x) == -x/y(x)]
sage: S2=S1[0].diff(x).subs(S1) ; S2
diff(y(x), x, x) == -x^2/y(x)^3 - 1/y(x)

BTW, neither Sage, Sympy nor Mathematica seem to be able to solve this ODE, at least under this form.

And none of this is necessary to solve for y(x), but I suppose (not having your reference on hand) that it's not the point of the exercise...

What version of Sage do you use ? With 10.1.beta8, the substitution is unproblematic. I changed notations a bit :

sage: reset()
sage: y=function("y")
sage: Eq=x^2+y(x)^2-1 ; Eq
x^2 + y(x)^2 - 1
sage: S1=Eq.diff(x).solve(diff(y(x))) ; S1
[diff(y(x), x) == -x/y(x)]
sage: S2=S1[0].diff(x).subs(S1) ; S2
diff(y(x), x, x) == -x^2/y(x)^3 - 1/y(x)

BTW, neither Sage, Sympy nor Mathematica seem to be able to solve this ODE, at least under this form.

And none of this is necessary to solve for y(x), but I suppose (not having your reference on hand) that it's not the point of the exercise...

EDIT : FWIW, sample implementation in Sagecell...