3.9.8.3 Example 3. \(y^{\prime \prime }\sin ^{2}\left ( 2x\right ) +y^{\prime }\sin \left ( 4x\right ) -4y=0\)

Writing the ode in normal form gives

\begin{align*} y^{\prime \prime }+p\left ( x\right ) y^{\prime }+q\left ( x\right ) y & =r\qquad \\ p & =\frac {\sin \left ( 4x\right ) }{\sin ^{2}\left ( 2x\right ) }\qquad \sin \left ( 2x\right ) \neq 0\\ q & =-\frac {4}{\sin ^{2}\left ( 2x\right ) }\end{align*}

Trying change of variable on the independent variable as above.  Let \(\tau =g\left ( x\right ) \) where \(\tau \) will be the new independent variable. Applying this transformation results in

\begin{equation} y^{\prime \prime }+p_{1}y^{\prime }+q_{1}y=r_{1} \tag {1}\end{equation}
Where
\begin{align} p_{1}\left ( \tau \right ) & =\frac {\tau ^{\prime \prime }\left ( x\right ) +p\left ( x\right ) \tau ^{\prime }\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}}\tag {2}\\ q_{1}\left ( \tau \right ) & =\frac {q\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}}\tag {3}\\ r_{1}\left ( \tau \right ) & =\frac {r\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}} \tag {4}\end{align}

Approach 1. Let \(q_{1}=c^{2}\) where \(c\) is some constant. This implies

\begin{align} \frac {q}{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}} & =c^{2}\nonumber \\ \tau & =\frac {1}{c}\int \sqrt {q}dx \tag {5}\end{align}

If with this \(\tau \), then \(p_{1}\) turns out to be constant, then it means (1) is second order constant coefficient ode. Applying this on the given ode (5) becomes

\begin{align*} \tau & =\frac {1}{c}\int \sqrt {-\frac {4}{\sin ^{2}\left ( 2x\right ) }}dx\\ & =\frac {2i}{c}\int \frac {1}{\sin \left ( 2x\right ) }dx\\ & =\frac {i}{c}\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) \end{align*}

Eq (2) now becomes

\begin{align*} p_{1}\left ( \tau \right ) & =\frac {\tau ^{\prime \prime }\left ( x\right ) +p\tau ^{\prime }\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}}\\ & =0 \end{align*}

Which is constant. Hence this transformation worked.  Therefore (1) becomes (since \(q_{1}=c^{2}\) is constant \(c^{2}\))

\begin{align*} y^{\prime \prime }\left ( \tau \right ) +p_{1}y^{\prime }\left ( \tau \right ) +q_{1}y\left ( \tau \right ) & =r_{1}\\ y^{\prime \prime }+c^{2}y & =0 \end{align*}

This gives

\[ y\left ( \tau \right ) =A\cos \left ( c\tau \right ) +B\sin \left ( c\tau \right ) \]
Using \(\tau =\frac {i}{c}\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) \) the above becomes
\[ y\left ( x\right ) =A\cos \left ( i\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) \right ) +B\sin \left ( i\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) \right ) \]
Simplifying using trig identities gives
\begin{align*} y\left ( x\right ) & =\frac {-iB\cos \left ( 2x\right ) +A}{\sin \left ( 2x\right ) }\\ & =\frac {B_{0}\cos \left ( 2x\right ) }{\sin \left ( 2x\right ) }+\frac {A}{\sin \left ( 2x\right ) }\\ & =B_{0}\cot \left ( 2x\right ) +A\csc (2x) \end{align*}

Approach 2  Let \(p_{1}=0\). If with this choice now \(q_{1}\) becomes constant or a constant divided by \(\tau ^{2}\) then (2) can be integrated.  \(p_{1}=0\) implies from (2) that

\begin{align*} \tau ^{\prime \prime }+p\tau ^{\prime } & =0\\ \tau & =\int e^{-\int pdx}dx\\ \tau & =\int e^{-\int \frac {\sin \left ( 4x\right ) }{\sin ^{2}\left ( 2x\right ) }dx}dx\\ \tau & =\int \frac {1}{\sin \left ( 2x\right ) }dx \end{align*}

Using this gives

\begin{align*} q_{1} & =\frac {q}{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}}\\ & =\frac {-\frac {4}{\sin ^{2}\left ( 2x\right ) }}{-\frac {1}{\frac {1}{\sin ^{2}\left ( 2x\right ) }}}\\ & =-4 \end{align*}

Which is a constant. Hence this transformation also works. Eq (1) now becomes

\begin{align*} y^{\prime \prime }+p_{1}y^{\prime }+q_{1}y & =r_{1}\\ y^{\prime \prime }\left ( \tau \right ) -4y\left ( \tau \right ) & =0\\ y\left ( \tau \right ) & =Ae^{-2\tau }+Be^{2\tau }\end{align*}

But \(\tau =\int \frac {1}{\sin \left ( 2x\right ) }dx=\frac {1}{2}\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) \), hence

\begin{align*} y\left ( x\right ) & =Ae^{-2\frac {1}{2}\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) }+Be^{2\frac {1}{2}\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) }\\ & =Ae^{-\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) }+Be^{\ln \left ( \csc \left ( 2x\right ) -\cot \left ( 2x\right ) \right ) }\\ & =\frac {A}{\csc \left ( 2x\right ) -\cot \left ( 2x\right ) }+B\csc \left ( 2x\right ) -\cot \left ( 2x\right ) \end{align*}

Which can be simplified to same solution shown in approach 1. This was an example where both sub methods of change of variable on the independent variable worked.