44.14.21 problem 3(e)

Internal problem ID [9345]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 2. Problems for Review and Discovery. Drill excercises. Page 105
Problem number : 3(e)
Date solved : Tuesday, September 30, 2025 at 06:16:44 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+9 y&=\sec \left (2 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 81
ode:=diff(diff(y(x),x),x)+9*y(x) = sec(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {2}{3}+\frac {\left (-4 \cos \left (x \right )^{3}+3 \cos \left (x \right )\right ) \sqrt {2}\, \operatorname {arctanh}\left (\cos \left (x \right ) \sqrt {2}\right )}{6}+\frac {\sin \left (x \right ) \left (-4 \cos \left (x \right )^{2}+1\right ) \sqrt {2}\, \operatorname {arctanh}\left (\sin \left (x \right ) \sqrt {2}\right )}{6}+4 c_1 \cos \left (x \right )^{3}+\frac {4 \left (3 \sin \left (x \right ) c_2 +1\right ) \cos \left (x \right )^{2}}{3}-3 c_1 \cos \left (x \right )-\sin \left (x \right ) c_2 \]
Mathematica. Time used: 0.094 (sec). Leaf size: 78
ode=D[y[x],{x,2}]+9*y[x]==Sec[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \cos (3 x) \int _1^x-\frac {1}{3} \sec (2 K[1]) \sin (3 K[1])dK[1]-\frac {\sin (3 x) \text {arctanh}\left (\sqrt {2} \sin (x)\right )}{3 \sqrt {2}}+\frac {2}{3} \sin (x) \sin (3 x)+c_1 \cos (3 x)+c_2 \sin (3 x) \end{align*}
Sympy. Time used: 9.104 (sec). Leaf size: 600
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) + Derivative(y(x), (x, 2)) - 1/cos(2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \text {Solution too large to show} \]