# Thread: Find the general solution!

1. ## Find the general solution!

I have got

y'+y = sin x.

How do I start this question?

THank you.

2. ## Re: Find the general solution!

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 $\displaystyle y = y_0 + y_p$.

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

-Dan

3. ## Re: Find the general solution!

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

To get $\displaystyle y_h$ (the homogeneous solution) set $\displaystyle 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 \displaystyle \begin{align*} e^{\int{1\,dx}} = e^x \end{align*}, so we have

\displaystyle \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 \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 \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*}

4. ## Re: Find the general solution!

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