12.10.8 problem 8

Internal problem ID [1812]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.7 Variation of Parameters. Page 262
Problem number : 8
Date solved : Saturday, March 29, 2025 at 11:40:11 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x y^{\prime \prime }+\left (2-2 x \right ) y^{\prime }+\left (x -2\right ) y&={\mathrm e}^{2 x} \end{align*}

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