67.15.39 problem 22.10 (L)

Internal problem ID [16757]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 22. Method of undetermined coefficients. Additional exercises page 412
Problem number : 22.10 (L)
Date solved : Thursday, October 02, 2025 at 01:38:32 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+9 y&={\mathrm e}^{2 x} \sin \left (x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 32
ode:=diff(diff(y(x),x),x)+9*y(x) = exp(2*x)*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (3 \sin \left (x \right )-\cos \left (x \right )\right ) {\mathrm e}^{2 x}}{40}+\cos \left (3 x \right ) c_1 +\sin \left (3 x \right ) c_2 \]
Mathematica. Time used: 0.127 (sec). Leaf size: 80
ode=D[y[x],{x,2}]+9*y[x]==Exp[2*x]*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \cos (3 x) \int _1^x-\frac {1}{3} e^{2 K[1]} \sin (K[1]) \sin (3 K[1])dK[1]+\sin (3 x) \int _1^x\frac {1}{3} e^{2 K[2]} \cos (3 K[2]) \sin (K[2])dK[2]+c_1 \cos (3 x)+c_2 \sin (3 x) \end{align*}
Sympy. Time used: 0.077 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) - exp(2*x)*sin(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (3 x \right )} + C_{2} \cos {\left (3 x \right )} + \frac {3 e^{2 x} \sin {\left (x \right )}}{40} - \frac {e^{2 x} \cos {\left (x \right )}}{40} \]