19.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, September 30, 2025 at 07:07:41 AM
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.018 (sec). Leaf size: 14
ode:=x^2*diff(y(x),x)-y(x)^2 = 0; 
ic:=[y(1) = -1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\frac {x}{2 x -1} \]
Mathematica. Time used: 0.073 (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]
 
\begin{align*} y(x)&\to \frac {x}{1-2 x} \end{align*}
Sympy. Time used: 0.088 (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} \]