22.1.92 problem 113

Internal problem ID [4398]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 113
Date solved : Tuesday, September 30, 2025 at 07:27:42 AM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=\frac {y+2}{x +1} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 10
ode:=diff(y(x),x) = (y(x)+2)/(1+x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_1 x +c_1 -2 \]
Mathematica. Time used: 0.018 (sec). Leaf size: 18
ode=D[y[x],x]== (y[x]+2)/(x+1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2+c_1 (x+1)\\ y(x)&\to -2 \end{align*}
Sympy. Time used: 0.122 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (y(x) + 2)/(x + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} x + C_{1} - 2 \]