12.10.13 problem 13

Internal problem ID [1817]
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 : 13
Date solved : Tuesday, March 04, 2025 at 01:43:51 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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