78.14.15 problem 4 (g)

Internal problem ID [18280]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 19. The Method of Variation of Parameters. Problems at page 135
Problem number : 4 (g)
Date solved : Monday, March 31, 2025 at 05:24:41 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 34
ode:=diff(diff(y(x),x),x)+y(x) = sec(x)*csc(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) c_2 +\cos \left (x \right ) c_1 +\ln \left (\csc \left (x \right )-\cot \left (x \right )\right ) \sin \left (x \right )-\ln \left (\sec \left (x \right )+\tan \left (x \right )\right ) \cos \left (x \right ) \]
Mathematica. Time used: 0.024 (sec). Leaf size: 30
ode=D[y[x],{x,2}] +y[x]==Sec[x]*Csc[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\sin (x) \text {arctanh}(\cos (x))+c_1 \cos (x)+c_2 \sin (x)+\cos (x) \left (-\coth ^{-1}(\sin (x))\right ) \]
Sympy. Time used: 0.338 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - 1/(sin(x)*cos(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \frac {\log {\left (\sin {\left (x \right )} - 1 \right )}}{2} - \frac {\log {\left (\sin {\left (x \right )} + 1 \right )}}{2}\right ) \cos {\left (x \right )} + \left (C_{2} + \frac {\log {\left (\cos {\left (x \right )} - 1 \right )}}{2} - \frac {\log {\left (\cos {\left (x \right )} + 1 \right )}}{2}\right ) \sin {\left (x \right )} \]