58.5.22 problem 22

Internal problem ID [14616]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 22
Date solved : Thursday, October 02, 2025 at 09:44:25 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (1\right )&=-5 \\ \end{align*}
Maple. Time used: 0.016 (sec). Leaf size: 11
ode:=2*x*(1+y(x))-(x^2+1)*diff(y(x),x) = 0; 
ic:=[y(1) = -5]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -2 x^{2}-3 \]
Mathematica. Time used: 0.021 (sec). Leaf size: 12
ode=2*x*(y[x]+1)-(x^2+1)*D[y[x],x]==0; 
ic={y[1]==-5}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2 x^2-3 \end{align*}
Sympy. Time used: 0.159 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*(y(x) + 1) - (x**2 + 1)*Derivative(y(x), x),0) 
ics = {y(1): -5} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - 2 x^{2} - 3 \]