64.12.23 problem 23

Internal problem ID [13456]
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 : 23
Date solved : Monday, March 31, 2025 at 07:58:24 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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