14.8.8 problem Problem 8

Internal problem ID [3741]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 8, Linear differential equations of order n. Section 8.4, Complex-Valued Trial Solutions. page 529
Problem number : Problem 8
Date solved : Tuesday, September 30, 2025 at 06:56:36 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y&=100 x \,{\mathrm e}^{x} \sin \left (x \right ) \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 36
ode:=diff(diff(y(x),x),x)-4*y(x) = 100*x*exp(x)*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-2 x} c_2 +{\mathrm e}^{2 x} c_1 -10 \,{\mathrm e}^{x} \left (\left (x +\frac {7}{5}\right ) \cos \left (x \right )+\sin \left (x \right ) \left (2 x -\frac {1}{5}\right )\right ) \]
Mathematica. Time used: 0.016 (sec). Leaf size: 44
ode=D[y[x],{x,2}]-4*y[x]==100*x*Exp[x]*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to c_1 e^{2 x}+c_2 e^{-2 x}-2 e^x ((10 x-1) \sin (x)+(5 x+7) \cos (x)) \end{align*}
Sympy. Time used: 0.091 (sec). Leaf size: 53
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-100*x*exp(x)*sin(x) - 4*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 2 x} + C_{2} e^{2 x} - 20 x e^{x} \sin {\left (x \right )} - 10 x e^{x} \cos {\left (x \right )} + 2 e^{x} \sin {\left (x \right )} - 14 e^{x} \cos {\left (x \right )} \]