15.6.19 problem 19

Internal problem ID [2976]
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 : 19
Date solved : Sunday, March 30, 2025 at 01:03:00 AM
CAS classification : [_exact, _rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

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

With initial conditions

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

Maple. Time used: 0.317 (sec). Leaf size: 135
ode:=y(x)^2+1+(2*x*y(x)-y(x)^2)*diff(y(x),x) = 0; 
ic:=y(0) = -1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\left (-4+12 x +8 x^{3}+4 \sqrt {12 x^{4}-4 x^{3}+9 x^{2}-6 x +1}\right )^{{1}/{3}} \left (i \sqrt {3}-1\right )}{4}-\frac {x \left (i x \sqrt {3}+x -\left (-4+12 x +8 x^{3}+4 \sqrt {12 x^{4}-4 x^{3}+9 x^{2}-6 x +1}\right )^{{1}/{3}}\right )}{\left (-4+12 x +8 x^{3}+4 \sqrt {12 x^{4}-4 x^{3}+9 x^{2}-6 x +1}\right )^{{1}/{3}}} \]
Mathematica. Time used: 5.178 (sec). Leaf size: 100
ode=(y[x]^2+1)+(2*x*y[x]-y[x]^2)*D[y[x],x]==0; 
ic={y[0]==-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {\sqrt [3]{2} x^2}{\sqrt [3]{-2 x^3+\sqrt {12 x^4-4 x^3+9 x^2-6 x+1}-3 x+1}}-\frac {\sqrt [3]{-2 x^3+\sqrt {12 x^4-4 x^3+9 x^2-6 x+1}-3 x+1}}{\sqrt [3]{2}}+x \]
Sympy. Time used: 171.797 (sec). Leaf size: 92
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x*y(x) - y(x)**2)*Derivative(y(x), x) + y(x)**2 + 1,0) 
ics = {y(0): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {3 x^{2}}{\sqrt [3]{- 27 x^{3} - \frac {81 x}{2} + \frac {27 \sqrt {- 4 x^{6} + \left (- 2 x^{3} - 3 x + 1\right )^{2}}}{2} + \frac {27}{2}}} + x - \frac {\sqrt [3]{- 27 x^{3} - \frac {81 x}{2} + \frac {27 \sqrt {- 4 x^{6} + \left (- 2 x^{3} - 3 x + 1\right )^{2}}}{2} + \frac {27}{2}}}{3} \]