58.12.5 problem 5

Internal problem ID [14790]
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 : 5
Date solved : Thursday, October 02, 2025 at 09:54:55 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 4 y+y^{\prime \prime }&=\sec \left (x \right )^{2} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 42
ode:=diff(diff(y(x),x),x)+4*y(x) = sec(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (1-2 \cos \left (x \right )^{2}\right ) \ln \left (\sec \left (x \right )\right )+2 c_1 \cos \left (x \right )^{2}+2 \sin \left (x \right ) \left (x +c_2 \right ) \cos \left (x \right )-\sin \left (x \right )^{2}-c_1 \]
Mathematica. Time used: 0.034 (sec). Leaf size: 33
ode=D[y[x],{x,2}]+4*y[x]==Sec[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \cos (2 x) (\log (\cos (x))+c_1)+\sin (x) (-\sin (x)+2 (x+c_2) \cos (x)) \end{align*}
Sympy. Time used: 0.215 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) + Derivative(y(x), (x, 2)) - 1/cos(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \log {\left (\cos {\left (x \right )} \right )}\right ) \cos {\left (2 x \right )} + \left (C_{2} + x - \frac {\tan {\left (x \right )}}{2}\right ) \sin {\left (2 x \right )} \]