32.4.10 problem 10

Internal problem ID [7783]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 25. Second order differential equations. Further problems 25. page 1094
Problem number : 10
Date solved : Tuesday, September 30, 2025 at 05:05:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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