56.6.2 problem Ex 2

Internal problem ID [14101]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter 2, differential equations of the first order and the first degree. Article 13. Linear equations of first order. Page 19
Problem number : Ex 2
Date solved : Thursday, October 02, 2025 at 09:13:39 AM
CAS classification : [_linear]

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