83.44.5 problem Ex 5 page 37

Internal problem ID [19533]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Book Solved Excercises. Chapter III. Ordinary linear differential equations with constant coefficients
Problem number : Ex 5 page 37
Date solved : Tuesday, January 28, 2025 at 01:49:57 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.007 (sec). Leaf size: 40

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

Solution by Mathematica

Time used: 0.037 (sec). Leaf size: 39

DSolve[D[y[x],{x,2}]+n^2*y[x]==Sec[n*x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {\cos (n x) \left (\log (\cos (n x))+c_1 n^2\right )+n (x+c_2 n) \sin (n x)}{n^2} \]