Home » Blog » Find the general solution of y′′ + y = cot2 x

Find the general solution of y′′ + y = cot2 x

Find the general solution of the second-order differential equation

    \[ y'' + y = \cot^2 x. \]

If the solution is not valid everywhere, describe the interval on which it is valid.


The general solution of the homogeneous equation

    \[ y'' + y = 0 \]

is given by Theorem 8.7 with a = 0 and b = 1. This gives us d = a^2 - 4b = -4; hence, k = \frac{1}{2} \sqrt{-d} = 1 and we have

    \begin{align*}  y &= e^{-\frac{ax}{2}} (c_1 \cos (kx)+ c_2 \sin (kx)) \\  &= c_1 \cos x + c_2 \sin x. \end{align*}

So, we obtain particular solutions of the of the homogeneous equation v_1(x) = \cos x and v_2(x) = sin x (by taking c_1 = 1, c_2 = 0 and c_1 = 0, c_2 = 1, respectively). We want to apply Theorem 8.9 (on page 330 of Apostol). From that theorem we have

    \[ R(x) = \cot^2 x. \]

Furthermore,

    \begin{align*}  W(x) &= v_1 v_2' - v_1' v_2 \\  &= (\cos x)(\cos x) - (-\sin x)(\sin x) \\  &= \cos^2 x + \sin^2 x \\  &= 1. \end{align*}

So, a particular solution y_1 to the non-homogeneous equation is given by

    \begin{align*}  y_1(x) &= t_1 (x) v_1(x) + t_2(x) v_2(x) \\  t_1(x) &= -\int v_2(x) \frac{R(x)}{W(x)} \, dx \\  &= -\int \frac{\cos^2 x}{\sin x} \, dx \\  &=  \log | \cot x + \csc x| - \cos x\\  t_2(x) &= \int v_1(x) \frac{R(x)}{W(x)} \, dx \\  &= \int \frac{\cos^3 x}{\sin^2 x} \, dx \\  &= \frac{-\sin^2 x - 1}{\sin x}. \end{align*}

This implies,

    \begin{align*}  y_1 &= \cos x ( \log | \cot x + \csc x| - \cos x) + \sin x \left( \frac{-\sin^2 x - 1}{\sin x} \right) \\  &= \cos x (\log | \cot x + \csc x |) - 2. \end{align*}

Therefore, the general solution is

    \[ y = \cos x (c_1 + \log | cot x + \csc x|) + c_2 \sin x - 2. \]

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):