Home » Blog » Find all solutions of the differential equation y′ + y cot x = 2 cos x

Find all solutions of the differential equation y′ + y cot x = 2 cos x

Find all solutions of the differential equation

    \[ y' + y \cot x = 2 \cos x \]

on the interval (0, \pi). Prove that exactly one of these solutions is valid on the larger interval (-\infty, +\infty).


Proof. We apply Theorem 8.3 (page 310 of Apostol) with

    \[ P(x) = \cot x, \qquad Q(x) = 2 \cos x. \]

Further, we choose a = \frac{\pi}{2} and obtain solutions in terms of b, this gives us

    \[ A(x) = \int_{\frac{\pi}{2}}^x \cot t \, dt = \log (\sin x). \]

Therefore,

    \begin{align*}  f(x) &= be^{- \log (\sin x)} + e^{-\log(\sin x)} \int_{\frac{\pi}{2}}^x 2(\cos t)e^{\log(\sin t)} \, dt \\[9pt]  &= \frac{b}{\sin x} + \frac{1}{\sin x} \int_{\frac{\pi}{2}}^x \sin (2t) \, dt \\[9pt]  &= \frac{b}{\sin x} - \frac{\cos (2x)}{2 \sin x} + \frac{1}{2 \sin x} \\[9pt]  &= \frac{b}{\sin x} - \frac{1-2\sin^2 x}{2 \sin x} + \frac{1}{2 \sin x} \\[9pt]  &= \frac{b}{\sin x} + \sin x. \end{align*}

These are then all of the solutions valid on (0, \pi). The only one of these solutions valid on the interval (-\infty, +\infty) is the one with b = 0, or f(x) = \sin x. \qquad \blacksquare

8 comments

  1. Mohammad Azad says:

    I got C=b-1. The question doesn’t make sense ,however, since cot(x) isn’t defined everywhere. It would have made sense if the differential equation was sin (x)y’ + cos(x)y = sin(2x) instead.

    • Luca says:

      Yeah, and regarding the holes in the solution I found that if you create a new function which fills in those holes to make the solution continuous everywhere, it is differentiable on R and satisfies the equation you’ve written here.

    • Mohammad Azad says:

      I got C=b-1 like the others, but I want to say the the problem doesn’t make sense because cot(x) is not defined everywhere. it would have worked if the differential equation was sin(x)y’ + cos(x)y = sin(2x) instead.

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