81.17.4 problem 21-16

Internal problem ID [21737]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 21. Applications of second order differential equations
Problem number : 21-16
Date solved : Thursday, October 02, 2025 at 08:01:36 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} \theta ^{\prime \prime }+4 \theta &=15 \cos \left (3 t \right ) \end{align*}

With initial conditions

\begin{align*} \theta \left (0\right )&=0 \\ \theta ^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 22
ode:=diff(diff(theta(t),t),t)+4*theta(t) = 15*cos(3*t); 
ic:=[theta(0) = 0, D(theta)(0) = 0]; 
dsolve([ode,op(ic)],theta(t), singsol=all);
 
\[ \theta = 6 \cos \left (t \right )^{2}-3-12 \cos \left (t \right )^{3}+9 \cos \left (t \right ) \]
Mathematica. Time used: 0.011 (sec). Leaf size: 18
ode=D[theta[t],{t,2}]+4*theta[t]==15*Cos[3*t]; 
ic={theta[0]==0,Derivative[1][theta][0] ==0}; 
DSolve[{ode,ic},theta[t],t,IncludeSingularSolutions->True]
 
\begin{align*} \theta (t)&\to 3 (\cos (2 t)-\cos (3 t)) \end{align*}
Sympy. Time used: 0.049 (sec). Leaf size: 15
from sympy import * 
t = symbols("t") 
theta = Function("theta") 
ode = Eq(4*theta(t) - 15*cos(3*t) + Derivative(theta(t), (t, 2)),0) 
ics = {theta(0): 0, Subs(Derivative(theta(t), t), t, 0): 0} 
dsolve(ode,func=theta(t),ics=ics)
 
\[ \theta {\left (t \right )} = 3 \cos {\left (2 t \right )} - 3 \cos {\left (3 t \right )} \]