6.7.7 problem 7

Internal problem ID [1717]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Exact equations. Integrating factors. Section 2.6 Page 91
Problem number : 7
Date solved : Tuesday, September 30, 2025 at 05:16:32 AM
CAS classification : [_linear]

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