81.12.8 problem 16-9

Internal problem ID [21661]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 16. Variation of Parameters. Page 375.
Problem number : 16-9
Date solved : Thursday, October 02, 2025 at 07:59:34 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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