58.2.30 problem 30

Internal problem ID [9153]
Book : Second order enumerated odes
Section : section 2
Problem number : 30
Date solved : Sunday, March 30, 2025 at 02:24:06 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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