81.3.6 problem 4-11

Internal problem ID [21505]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 4. Homogeneous differential equations.
Problem number : 4-11
Date solved : Thursday, October 02, 2025 at 07:43:04 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Bernoulli]

\begin{align*} 2 x y y^{\prime }&=y^{2}-x^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 27
ode:=2*x*y(x)*diff(y(x),x) = -x^2+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {\left (-x +c_1 \right ) x} \\ y &= -\sqrt {\left (-x +c_1 \right ) x} \\ \end{align*}
Mathematica. Time used: 0.11 (sec). Leaf size: 37
ode=2*x*y[x]*D[y[x],x] ==y[x]^2-x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\sqrt {-x (x-c_1)}\\ y(x)&\to \sqrt {-x (x-c_1)} \end{align*}
Sympy. Time used: 0.266 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2 + 2*x*y(x)*Derivative(y(x), x) - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {x \left (C_{1} - x\right )}, \ y{\left (x \right )} = \sqrt {x \left (C_{1} - x\right )}\right ] \]