10.10.6 problem 6

Internal problem ID [1338]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Chapter 3, Second order linear equations, section 3.6, Variation of Parameters. page 190
Problem number : 6
Date solved : Saturday, March 29, 2025 at 10:52:36 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.009 (sec). Leaf size: 33
ode:=diff(diff(y(t),t),t)+9*y(t) = 9*sec(3*t)^2; 
dsolve(ode,y(t), singsol=all);
 
\[ y = \sin \left (3 t \right ) c_2 +\cos \left (3 t \right ) c_1 +\ln \left (\sec \left (3 t \right )+\tan \left (3 t \right )\right ) \sin \left (3 t \right )-1 \]
Mathematica. Time used: 0.082 (sec). Leaf size: 31
ode=D[y[t],{t,2}]+9*y[t] == 9*Sec[3*t]^2; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to c_1 \cos (3 t)+\sin (3 t) \coth ^{-1}(\sin (3 t))+c_2 \sin (3 t)-1 \]
Sympy. Time used: 0.345 (sec). Leaf size: 37
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(9*y(t) + Derivative(y(t), (t, 2)) - 9/cos(3*t)**2,0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = C_{2} \cos {\left (3 t \right )} + \left (C_{1} - \frac {\log {\left (\sin {\left (3 t \right )} - 1 \right )}}{2} + \frac {\log {\left (\sin {\left (3 t \right )} + 1 \right )}}{2}\right ) \sin {\left (3 t \right )} - 1 \]