28.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, March 04, 2025 at 06:39:14 PM
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 \left (x \right ) = c_{1} x +c_{1} -2 \]
Mathematica. Time used: 0.033 (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.230 (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 \]