# Find the general solution!

• Nov 18th 2012, 09:05 AM
tjsdndnjs
Find the general solution!
I have got

y'+y = sin x.

How do I start this question?

THank you.
• Nov 18th 2012, 09:26 AM
topsquark
Re: Find the general solution!
Quote:

Originally Posted by tjsdndnjs
I have got

y'+y = sin x.

How do I start this question?

THank you.

The solution will be of the form $y = y_0 + y_p$.

To get $y_h$ (the homogeneous solution) set $y' + y = 0$. To get the particular solution I'd use the method of undetermined coefficients.

-Dan
• Nov 18th 2012, 06:29 PM
Prove It
Re: Find the general solution!
Quote:

Originally Posted by topsquark
The solution will be of the form $y = y_0 + y_p$.

To get $y_h$ (the homogeneous solution) set $y' + y = 0$. To get the particular solution I'd use the method of undetermined coefficients.

-Dan

Really? It's not a second order linear DE, it's first order linear... The integrating factor is \displaystyle \begin{align*} e^{\int{1\,dx}} = e^x \end{align*}, so we have

\displaystyle \begin{align*} \frac{dy}{dx} + y &= \sin{x} \\ e^{x}\,\frac{dy}{dx} + e^{x}\,y &= e^x\,\sin{x} \\ \frac{d}{dx}\left( e^x\, y \right) &= e^x\,\sin{x} \\ e^x\,y &= \int{ e^x\, \sin{x} \, dx} \\ y &= e^{-x} \int{ e^x \, \sin{x} \, dx} \end{align*}

Now to solve that ugly integral, use integration by parts...

\displaystyle \begin{align*} I &= \int{e^x \, \sin{x}\, dx} \\ I &= e^x\,\sin{x} - \int{ e^x \, \cos{x} \, dx } \\ I &= e^x\, \sin{x} - \left( e^x\,\cos{x} - \int{ -e^x\, \sin{x} \, dx } \right) \\ I &= e^x \, \sin{x} - e^x\, \cos{x} - \int{e^x\, \sin{x} \, dx} \\ I &= e^x\,\sin{x} - e^x\,\cos{x} - I \\ 2I &= e^x\,\sin{x} - e^x\,\cos{x} \\ I &= \frac{1}{2} \, e^x\left( \sin{x} - \cos{x} \right) \end{align*}

So the solution to your DE is \displaystyle \begin{align*} y = e^{-x} \left[ \frac{1}{2} \, e^x \left( \sin{x} - \cos{x} \right) \right] + C = \frac{1}{2} \left( \sin{x} - \cos{x} \right) + C \end{align*}
• Nov 19th 2012, 02:37 PM
topsquark
Re: Find the general solution!
Quote:

Originally Posted by Prove It
Really? It's not a second order linear DE, it's first order linear...

(shrugs) It's my favorite method. I've always found the integrating factor method to be somewhat clumsy. But that's my own opinion.

-Dan