86.2.16 problem 16

Internal problem ID [23090]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 3. Some standard types of differential equations. Exercise 3c at page 50
Problem number : 16
Date solved : Thursday, October 02, 2025 at 09:19:58 PM
CAS classification : [_linear]

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