34.13.4 problem 24

Internal problem ID [8045]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 18. Linear equations with variable coefficients (Equations of second order). Supplemetary problems. Page 120
Problem number : 24
Date solved : Tuesday, September 30, 2025 at 05:14:41 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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