12.10.10 problem 10

Internal problem ID [1814]
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 : 10
Date solved : Saturday, March 29, 2025 at 11:40:14 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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