40.10.2 problem 11

Internal problem ID [6724]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 15. Linear equations with constant coefficients (Variation of parameters). Supplemetary problems. Page 98
Problem number : 11
Date solved : Sunday, March 30, 2025 at 11:20:40 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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