65.13.4 problem 4

Internal problem ID [15811]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 5. The Laplace Transform Method. Exercises 5.2, page 248
Problem number : 4
Date solved : Thursday, October 02, 2025 at 10:28:14 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-9 y&=2 \sin \left (3 x \right ) \end{align*}

Using Laplace method

Maple. Time used: 0.106 (sec). Leaf size: 30
ode:=diff(diff(y(x),x),x)-9*y(x) = 2*sin(3*x); 
dsolve(ode,y(x),method='laplace');
 
\[ y = -\frac {\sin \left (3 x \right )}{9}+y \left (0\right ) \cosh \left (3 x \right )+\frac {\sinh \left (3 x \right ) \left (1+3 y^{\prime }\left (0\right )\right )}{9} \]
Mathematica. Time used: 0.011 (sec). Leaf size: 30
ode=D[y[x],{x,2}]-9*y[x]==2*Sin[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{9} \sin (3 x)+c_1 e^{3 x}+c_2 e^{-3 x} \end{align*}
Sympy. Time used: 0.046 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-9*y(x) - 2*sin(3*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 3 x} + C_{2} e^{3 x} - \frac {\sin {\left (3 x \right )}}{9} \]