83.17.5 problem 5

Internal problem ID [19130]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter III. Ordinary linear differential equations with constant coefficients. Misc. Examples on chapter III at page 50
Problem number : 5
Date solved : Monday, March 31, 2025 at 06:49:12 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.003 (sec). Leaf size: 36
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+4*y(x) = 8*x^2*exp(2*x)*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} \left (c_2 +c_1 x -2 \sin \left (2 x \right ) x^{2}-4 \cos \left (2 x \right ) x +3 \sin \left (2 x \right )\right ) \]
Mathematica. Time used: 0.027 (sec). Leaf size: 37
ode=D[y[x],{x,2}]-4*D[y[x],x]+4*y[x]==8*x^2*Exp[2*x]*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{2 x} \left (\left (3-2 x^2\right ) \sin (2 x)-4 x \cos (2 x)+c_2 x+c_1\right ) \]
Sympy. Time used: 0.426 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-8*x**2*exp(2*x)*sin(2*x) + 4*y(x) - 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + x \left (C_{2} - 2 x \sin {\left (2 x \right )} - 4 \cos {\left (2 x \right )}\right ) + 3 \sin {\left (2 x \right )}\right ) e^{2 x} \]