12.3.16 problem 17

Internal problem ID [1593]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. separable equations. Section 2.2 Page 52
Problem number : 17
Date solved : Tuesday, March 04, 2025 at 12:53:18 PM
CAS classification : [_separable]

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

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