Home » Blog » Determine the general solution of y′′ + y = sin x

Determine the general solution of y′′ + y = sin x

Determine the general solution of the second-order differential equation

    \[ y'' + y = \sin x. \]


The homogeneous equation related to this is an equation of the form y'' + ay' + by = 0 with a = 0 and b = 1. This gives us d = a^2 - 4b = -4 and k = \frac{1}{2} \sqrt{-d} = 1. So, the general solution of the homogeneous equation y'' + y = 0 is given by

    \[ y = c_1 \cos x + c_2 \sin x. \]

Then by the previous exercise we know that a particular solution y_1 for the non-homogeneous equation is given by

    \begin{align*}  y_1 &= \frac{1}{k} \int_0^x R(t) \sin (k(x-t)) \, dt\\  &= \int_0^x (\sin t)(\sin (x-t)) \, dt \\  &= \int_0^x (\sin t)(\sin x \cos t - \sin t \cos x) \, dt \\  &= -\cos x \int_0^x \sin^2 t \, dt + \sin x \int_0^x \frac{\sin (2t)}{2} \, dt\\  &= \frac{1}{2} \sin^3 x - \frac{1}{2} x \cos x + \frac{1}{2} \sin x \cos^2 x. \end{align*}

Therefore, the general solution of the given equation is

    \begin{align*}  y &= \left( c_1 - \frac{x}{2} \right) \cos x + \left( c_2 + \frac{1}{2} (\sin^2 x + \cos^2 x) \right) \sin x \\  &= \left( c_1 - \frac{x}{2} \right) \cos x + c_2 \sin x. \end{align*}

(Where we absorbed the \frac{1}{2} in the value of the constant c_2.)

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