39.5.16 problem Problem 24.46

Internal problem ID [6558]
Book : Schaums Outline Differential Equations, 4th edition. Bronson and Costa. McGraw Hill 2014
Section : Chapter 24. Solutions of linear DE by Laplace transforms. Supplementary Problems. page 248
Problem number : Problem 24.46
Date solved : Sunday, March 30, 2025 at 11:07:20 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} q^{\prime \prime }+9 q^{\prime }+14 q&=\frac {\sin \left (t \right )}{2} \end{align*}

Using Laplace method With initial conditions

\begin{align*} q \left (0\right )&=0\\ q^{\prime }\left (0\right )&=1 \end{align*}

Maple. Time used: 0.104 (sec). Leaf size: 25
ode:=diff(diff(q(t),t),t)+9*diff(q(t),t)+14*q(t) = 1/2*sin(t); 
ic:=q(0) = 0, D(q)(0) = 1; 
dsolve([ode,ic],q(t),method='laplace');
 
\[ q = -\frac {101 \,{\mathrm e}^{-7 t}}{500}+\frac {11 \,{\mathrm e}^{-2 t}}{50}-\frac {9 \cos \left (t \right )}{500}+\frac {13 \sin \left (t \right )}{500} \]
Mathematica. Time used: 0.023 (sec). Leaf size: 32
ode=D[ q[t],{t,2}]+9*D[ q[t],t]+14*q[t]==1/2*Sin[t]; 
ic={q[0]==0,Derivative[1][q][0]==1}; 
DSolve[{ode,ic},q[t],t,IncludeSingularSolutions->True]
 
\[ q(t)\to \frac {1}{500} \left (-101 e^{-7 t}+110 e^{-2 t}+13 \sin (t)-9 \cos (t)\right ) \]
Sympy. Time used: 0.260 (sec). Leaf size: 32
from sympy import * 
t = symbols("t") 
q = Function("q") 
ode = Eq(14*q(t) - sin(t)/2 + 9*Derivative(q(t), t) + Derivative(q(t), (t, 2)),0) 
ics = {q(0): 0, Subs(Derivative(q(t), t), t, 0): 1} 
dsolve(ode,func=q(t),ics=ics)
 
\[ q{\left (t \right )} = \frac {13 \sin {\left (t \right )}}{500} - \frac {9 \cos {\left (t \right )}}{500} + \frac {11 e^{- 2 t}}{50} - \frac {101 e^{- 7 t}}{500} \]