56.30.8 problem Ex 8

Internal problem ID [14253]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter VIII, Linear differential equations of the second order. Article 53. Change of dependent variable. Page 125
Problem number : Ex 8
Date solved : Thursday, October 02, 2025 at 09:27:14 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x y^{\prime \prime }+2 y^{\prime }-y x&=2 \,{\mathrm e}^{x} \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 21
ode:=x*diff(diff(y(x),x),x)+2*diff(y(x),x)-x*y(x) = 2*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\sinh \left (x \right ) c_2}{x}+\frac {\cosh \left (x \right ) c_1}{x}+{\mathrm e}^{x} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 35
ode=x*D[y[x],{x,2}]+2*D[y[x],x]-x*y[x]==2*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {e^{-x} \left (e^{2 x} (2 x-1+c_2)+2 c_1\right )}{2 x} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*y(x) + x*Derivative(y(x), (x, 2)) - 2*exp(x) + 2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -x*y(x)/2 + x*Derivative(y(x), (x, 2))/2 - exp(x) + Derivative(y(x), x) cannot be solved by the factorable group method