40.13.4 problem 24

Internal problem ID [6758]
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 : Sunday, March 30, 2025 at 11:21:40 AM
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.146 (sec). Leaf size: 32
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]
 
\[ y(x)\to \frac {1}{2} e^x \left (2 e^x x+e c_2 (x+2) x+2 e c_1\right ) \]
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