64.12.4 problem 4

Internal problem ID [13437]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 4
Date solved : Monday, March 31, 2025 at 07:57:51 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=diff(diff(y(x),x),x)+y(x) = sec(x)^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-1+c_1 \right ) \cos \left (x \right )+\sin \left (x \right ) c_2 +\frac {\sec \left (x \right )}{2} \]
Mathematica. Time used: 0.039 (sec). Leaf size: 25
ode=D[y[x],{x,2}]+y[x]==Sec[x]^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {\sec (x)}{2}+c_1 \cos (x)+\sin (x) (\tan (x)+c_2) \]
Sympy. Time used: 0.237 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - 1/cos(x)**3,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} - \frac {\cos {\left (2 x \right )}}{2 \cos {\left (x \right )}} \]