36.1.20 problem 20

Internal problem ID [6275]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.2, Separable Equations. Exercises. page 46
Problem number : 20
Date solved : Sunday, March 30, 2025 at 10:48:15 AM
CAS classification : [_separable]

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

With initial conditions

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

Maple. Time used: 0.127 (sec). Leaf size: 43
ode:=x^2*diff(y(x),x) = (4*x^2-x-2)/(1+x)/(1+y(x)); 
ic:=y(1) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\sqrt {2}\, \sqrt {3 \ln \left (x +1\right ) x^{2}-3 \ln \left (2\right ) x^{2}+x \left (\ln \left (x \right ) x +2\right )}-x}{x} \]
Mathematica. Time used: 0.406 (sec). Leaf size: 36
ode=x^2*D[y[x],x]==(4*x^2-x-2)/((x+1)*(y[x]+1)); 
ic={y[1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\sqrt {2 x \log (x)+6 x \log (x+1)-6 x \log (2)+4}}{\sqrt {x}}-1 \]
Sympy. Time used: 0.994 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - (4*x**2 - x - 2)/((x + 1)*(y(x) + 1)),0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = -1 + \frac {\sqrt {x \left (2 x \log {\left (x \right )} + 6 x \log {\left (x + 1 \right )} + x \left (- \log {\left (64 \right )} - 1\right ) + x + 4\right )}}{x} \]