20.9.3 problem Problem 3

Internal problem ID [3747]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 8, Linear differential equations of order n. Section 8.7, The Variation of Parameters Method. page 556
Problem number : Problem 3
Date solved : Sunday, March 30, 2025 at 02:07:12 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.010 (sec). Leaf size: 23
ode:=diff(diff(y(x),x),x)+9*y(x) = 18*sec(3*x)^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 -2\right ) \cos \left (3 x \right )+\sin \left (3 x \right ) c_2 +\sec \left (3 x \right ) \]
Mathematica. Time used: 0.095 (sec). Leaf size: 32
ode=D[y[x],{x,2}]+9*y[x]==18*Sec[3*x]^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \sec (3 x) ((-2+c_1) \cos (6 x)+c_2 \sin (6 x)+c_1) \]
Sympy. Time used: 0.291 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) + Derivative(y(x), (x, 2)) - 18/cos(3*x)**3,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (3 x \right )} + C_{2} \cos {\left (3 x \right )} - \frac {\cos {\left (6 x \right )}}{\cos {\left (3 x \right )}} \]