65.11.3 problem 18.1 (iii)

Internal problem ID [13792]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 18, The variation of constants formula. Exercises page 168
Problem number : 18.1 (iii)
Date solved : Tuesday, January 28, 2025 at 06:03:33 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.004 (sec). Leaf size: 35

dsolve(diff(y(x),x$2)+4*y(x)=cot(2*x),y(x), singsol=all)
 
\[ y = \sin \left (2 x \right ) c_{2} +\cos \left (2 x \right ) c_{1} +\frac {\sin \left (2 x \right ) \ln \left (\csc \left (2 x \right )-\cot \left (2 x \right )\right )}{4} \]

Solution by Mathematica

Time used: 0.119 (sec). Leaf size: 67

DSolve[D[y[x],{x,2}]+4*y[x]==Cot[2*x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \cos (2 x) \int _1^x-\frac {1}{2} \cos (2 K[1])dK[1]+\sin (2 x) \int _1^x\frac {1}{2} \cos (2 K[2]) \cot (2 K[2])dK[2]+c_1 \cos (2 x)+c_2 \sin (2 x) \]