86.2.17 problem 17

Internal problem ID [23091]
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 : 17
Date solved : Thursday, October 02, 2025 at 09:20:01 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }&=\frac {x +y+2}{1+x} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=-1 \\ \end{align*}
Maple. Time used: 0.008 (sec). Leaf size: 16
ode:=diff(y(x),x) = (x+y(x)+2)/(1+x); 
ic:=[y(0) = -1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \ln \left (x +1\right ) x +\ln \left (x +1\right )-1 \]
Mathematica. Time used: 0.021 (sec). Leaf size: 15
ode=D[y[x],x]==(x+y[x]+2)/(x+1); 
ic={y[0]==-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to (x+1) \log (x+1)-1 \end{align*}
Sympy. Time used: 0.165 (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 = {y(0): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \log {\left (x + 1 \right )} + \log {\left (x + 1 \right )} - 1 \]