25.1.11 problem 11

Internal problem ID [4223]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 11
Date solved : Tuesday, March 04, 2025 at 05:56:40 PM
CAS classification : [_separable]

\begin{align*} x^{2} y^{\prime }-y^{2}&=0 \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&=-1 \end{align*}

Maple. Time used: 0.025 (sec). Leaf size: 14
ode:=x^2*diff(y(x),x)-y(x)^2 = 0; 
ic:=y(1) = -1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y \left (x \right ) = -\frac {x}{2 x -1} \]
Mathematica. Time used: 0.121 (sec). Leaf size: 14
ode=x^2*D[y[x],x]-y[x]^2==0; 
ic=y[1]==-1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x}{1-2 x} \]
Sympy. Time used: 0.158 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - y(x)**2,0) 
ics = {y(1): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {x}{2 x - 1} \]