62.30.8 problem Ex 8

Internal problem ID [12893]
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 : Wednesday, March 05, 2025 at 08:50:42 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.008 (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 {{\mathrm e}^{x} x +\cosh \left (x \right ) c_{1} +\sinh \left (x \right ) c_{2}}{x} \]
Mathematica. Time used: 0.03 (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]
 
\[ y(x)\to \frac {e^{-x} \left (e^{2 x} (2 x-1+c_2)+2 c_1\right )}{2 x} \]
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