64.12.17 problem 17

Internal problem ID [13442]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 17
Date solved : Wednesday, March 05, 2025 at 10:00:40 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+3 y^{\prime }+2 y&=\frac {{\mathrm e}^{-x}}{x} \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)+3*diff(y(x),x)+2*y(x) = exp(-x)/x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-\int {\mathrm e}^{-x} \left (\operatorname {Ei}_{1}\left (-x \right )-c_{1} \right )d x +c_{2} \right ) {\mathrm e}^{-x} \]
Mathematica. Time used: 0.043 (sec). Leaf size: 43
ode=D[y[x],{x,2}]+3*D[y[x],x]+2*y[x]==Exp[-x]/x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} \left (\int _1^x-\frac {e^{K[1]}}{K[1]}dK[1]+e^x \log (x)+c_2 e^x+c_1\right ) \]
Sympy. Time used: 0.522 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) + 3*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \left (C_{2} - \operatorname {Ei}{\left (x \right )}\right ) e^{- x} + \log {\left (x \right )}\right ) e^{- x} \]