15.6.23 problem 23

Internal problem ID [2980]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 10, page 41
Problem number : 23
Date solved : Sunday, March 30, 2025 at 01:03:11 AM
CAS classification : [[_homogeneous, `class G`], _rational]

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

With initial conditions

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

Maple. Time used: 0.115 (sec). Leaf size: 41
ode:=y(x)+2*(x-2*y(x)^2)*diff(y(x),x) = 0; 
ic:=y(2) = -1; 
dsolve([ode,ic],y(x), singsol=all);
 
\begin{align*} y &= -\frac {\sqrt {-2 \sqrt {x^{2}-4}+2 x}}{2} \\ y &= -\frac {\sqrt {2 \sqrt {x^{2}-4}+2 x}}{2} \\ \end{align*}
Mathematica. Time used: 2.129 (sec). Leaf size: 55
ode=y[x]+2*(x-2*y[x]^2)*D[y[x],x]==0; 
ic={y[2]==-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\sqrt {x-\sqrt {x^2-4}}}{\sqrt {2}} \\ y(x)\to -\frac {\sqrt {\sqrt {x^2-4}+x}}{\sqrt {2}} \\ \end{align*}
Sympy. Time used: 3.326 (sec). Leaf size: 48
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x - 4*y(x)**2)*Derivative(y(x), x) + y(x),0) 
ics = {y(2): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \frac {\sqrt {2} \sqrt {x - \sqrt {x^{2} - 4}}}{2}, \ y{\left (x \right )} = - \frac {\sqrt {2} \sqrt {x + \sqrt {x^{2} - 4}}}{2}\right ] \]