72.18.4 problem 4

Internal problem ID [14878]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 4. Forcing and Resonance. Section 4.3 page 424
Problem number : 4
Date solved : Thursday, March 13, 2025 at 05:18:08 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 29
ode:=diff(diff(y(t),t),t)+4*y(t) = 3*cos(2*t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = \frac {\left (8 c_{2} +6 t \right ) \sin \left (2 t \right )}{8}+\frac {\left (8 c_{1} +3\right ) \cos \left (2 t \right )}{8} \]
Mathematica. Time used: 0.037 (sec). Leaf size: 64
ode=D[y[t],{t,2}]+4*y[t]==3*Cos[2*t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \sin (2 t) \int _1^t\frac {3}{2} \cos ^2(2 K[2])dK[2]+\cos (2 t) \int _1^t-\frac {3}{4} \sin (4 K[1])dK[1]+c_1 \cos (2 t)+c_2 \sin (2 t) \]
Sympy. Time used: 0.090 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(4*y(t) - 3*cos(2*t) + Derivative(y(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = C_{2} \cos {\left (2 t \right )} + \left (C_{1} + \frac {3 t}{4}\right ) \sin {\left (2 t \right )} \]