20.5.6 problem Problem 6

Internal problem ID [3689]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.9, Exact Differential Equations. page 91
Problem number : Problem 6
Date solved : Sunday, March 30, 2025 at 02:05:48 AM
CAS classification : [[_homogeneous, `class G`], _exact, _rational, _Bernoulli]

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

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