# Thread: Two First Order Differentia Questions

1. ## Two First Order Differentia Questions

Hi

I am having trouble getting the correct answer according to my textbook
This is what i have done:
1) $\displaystyle y'+3y=2cosx$
$\displaystyle I=e^{3x}$
$\displaystyle e^{3x}(y'+3y)=2e^{3x}cos(x)$
$\displaystyle e^{3x}y=2\int e^{3x}cos(x) dx$

$\displaystyle u=e^{3x}$ $\displaystyle du=3e^{3x}$
$\displaystyle dv=cos(x)$ $\displaystyle v=sin(x)$

$\displaystyle 2\int e^{3x}cos(x)=e^{3x}sin(x)-3\int e^{3x}sin(x) dx$

$\displaystyle u=e^{3x}$ $\displaystyle du=3e^{3x}$
$\displaystyle dv=sin(x)$ $\displaystyle v=-cos(x)$

$\displaystyle 2\int e^{3x}cos(x)=e^{3x}sin(x)-3[-e^{3x}cos(x) -\int -3e^{3x}cos(x) dx]$

$\displaystyle 2\int e^{3x}cos(x)=e^{3x}sin(x)+3e^{3x}cos(x) -3[3\int e^{3x}cos(x) dx]$

$\displaystyle 2\int e^{3x}cos(x)=e^{3x}sin(x)+3e^{3x}cos(x) +9\int e^{3x}cos(x) dx$
$\displaystyle 11\int e^{3x}cos(x) = e^{3x}sin(x)+3e^{3x}cos(x)$
$\displaystyle \int e^{3x}cos(x) = \frac{e^{3x}sin(x)+3e^{3x}cos(x)}{11}$

go back to original equation:
$\displaystyle e^{3x}y=\frac{e^{3x}sin(x)+3e^{3x}cos(x)}{11}$
$\displaystyle y=\frac{1}{11}sin(x)+\frac{3}{11}3cos(x)$

2) $\displaystyle y' +3y=5cos(2x)$
$\displaystyle I=e^{3x}$

$\displaystyle e^{3x}(y'+3y)=e^{3x}(5cos(2x))$
$\displaystyle \frac{d(e^{3x})}{dx}=5e^{3x}cos(2x)$
$\displaystyle e^{3x}y=5\inte^{3x}cos(2x)$

$\displaystyle u=e^{3x}$$\displaystyle du=3e^{3x} \displaystyle dv=cos(2x) \displaystyle v=\frac{sin(2x)}{2} \displaystyle 5\int e^{3x}cos(2x)=\frac{1}{2}e^{3x}sin(2x)-\frac{3}{2}\int e^{3x}sin(2x) \displaystyle u=e^{3x} \displaystyle du=3e^{3x} \displaystyle dv=sin(2x) \displaystyle v=\frac{-cos(2x)}{2} \displaystyle 5\int e^{3x}cos(2x)=\frac{1}{2}e^{3x}sin(2x)-\frac{3}{2}[e^{3x}*\frac{-cos(2x)}{2}]+\frac{3}{2}[\frac{-3e^{3x}cos(2x)}{2}] \displaystyle 5\int e^{3x}cos(2x)=\frac{1}{2}e^{3x}sin(2x)-\frac{3}{4}e^{3x}-cos(2x)-\frac{9}{4}e^{3x}cos(2x) \displaystyle \frac{29}{4}\int e^{3x}cos(2x)=\frac{1}{2}e^{3x}sin(2x)-\frac{3}{4}e^{3x} \displaystyle \int e^{3x}cos(2x)=\frac{\frac{1}{2}e^{3x}sin(2x)-\frac{3}{4}e^{3x}}{\frac{29}{4}} sub back into original equation: \displaystyle y=\frac{2}{29}sin(2x)+\frac{3}{29}cos(2x)+Ce^{-3x} P.S 2. With regard to your solution of 1): a. You forgot the constant of integration on the RHS. b. I think your constants might be a little bit off. Check them again, especially with respect to your integration by parts. With regard to your solution of 2): I think your constants are off again. Check the same thing as with your solution of #1. In general, you've got the right method of solution. Just make sure the details are correct! 3. after doing the questions again i get a different answer. This time i have integrated with the constant values inside the integral. 1) \displaystyle e^{3x}=\int 2e^{3x}cos(x) \displaystyle u=2e^{3x} \displaystyle du=6e^{3x} \displaystyle dv=cos(x) \displaystyle v=sin(x) \displaystyle \int 2e^{3x}cos(x) = 2e^{3x}sin(x) - 6\int e^{3x}sin(x) \displaystyle u=e^{3x}$$\displaystyle du=3e^{3x}$

$\displaystyle dv=sin(x)$ $\displaystyle v=-cos(x)$

$\displaystyle \int 2e^{3x}cos(x) = 2e^{3x}sin(x) + 6e^{3x}cos(x)-18e^{3x}cos(x)$
$\displaystyle \int 20e^{3x}cos(x) = 2e^{3x}sin(x) + 6e^{3x}cos(x)$
$\displaystyle \int e^{3x}cos(x)=\frac{2}{20}e^{3x}sin(x)+\frac{6}{20} e^{3x}cos(x)$
$\displaystyle \int e^{3x}cos(x)=\frac{1}{10}e^{3x}sin(x)+\frac{3}{10} e^{3x}cos(x)$

$\displaystyle e^{3x}y=\frac{1}{10}e^{3x}sin(x)+\frac{3}{10}e^{3x }cos(x) + C$

$\displaystyle y=\frac{1}{10}sin(x)+\frac{3}{10}cos(x) +Ce^{-3x}$

2)
$\displaystyle e^{3x}y=\int 5e^{3x}cos(2x)$

$\displaystyle u=5e^{3x}$ $\displaystyle du=15e^{3x}$
$\displaystyle dv=cos(2x)$ $\displaystyle v=sin(2x)$
$\displaystyle /int 5e^{3x}cos(2x)=/frac{5}{2}e^{3x}sin(2x)-\int \frac{15}{2}e^{3x}sin(2x)$

$\displaystyle u=\frac{15}{2}e^{3x}$ $\displaystyle du=\frac{45}{2}e^{3x}$
$\displaystyle dv=cos(2x)$ $\displaystyle v=\frac{-cos(2x)}{2}$

$\displaystyle \int 5e^{3x}cos(2x)=\frac{5}{2}e^{3x}sin(2x)+\frac{15}{ 4}e^{3x}cos(2x)+\frac{45}{4}e^{3x}cos(2x)$

$\displaystyle \frac{-25}{4}/int e^{3x}cos(2x)=\frac{5}{2}e^{3x}sin(2x)+\frac{15}{4 }e^{3x}cos(2x)$

$\displaystyle \int e^{3x}cos(2x)=\frac{-20}{50}e^{3x}sin(2x)+\frac{60}{100}e^{3x}cos(2x)$

$\displaystyle \int e^{3x}cos(2x)=\frac{-2}{5}e^{3x}sin(2x)+\frac{3}{2}e^{3x}cos(2x)$

$\displaystyle e^{3x}y=\frac{-2}{5}e^{3x}sin(2x)+\frac{3}{2}e^{3x}cos(2x)+C$

$\displaystyle y=\frac{-2}{5}sin(2x)+\frac{3}{5}cos(2x)+Ce^{-3x}$

4. I still don't buy either solution. You can always check your work by plugging back into the DE, you know.

In the first problem, a 0 appears mysteriously inside an integral. In the second problem, you have a bit of a messed up notation there. Try cleaning things up, and making sure extra digits don't appear where they're not wanted.

5. Originally Posted by Ackbeet
In the first problem, a 0 appears mysteriously inside an integral.

Would you tell me which line this is.

6. Hmm. Actually, the first issue I raised wasn't the problem. Since you obviously know all the steps required to solve the problem, I'll just post a complete solution here for both problems. Then you can check your work against mine.

1. $\displaystyle y'+3y=2\cos(x).$

$\displaystyle \displaystyle{e^{3x}y'+3e^{3x}y=2e^{3x}\cos(x)}$

$\displaystyle \displaystyle{(e^{3x}y)'=2e^{3x}\cos(x)}$

$\displaystyle \displaystyle{e^{3x}y-C=2\int e^{3x}\cos(x)\,dx}$

Here I have used the $\displaystyle -C$ for the constant of integration on the LHS so I don't have to have one on the RHS.

We will investigate the remaining integral. Let $\displaystyle u=e^{3x}$. Then $\displaystyle du=3\,e^{3x}\,dx.$ Let $\displaystyle dv=\cos(x)\,dx$. Then $\displaystyle v=\sin(x)$. It follows, then, that

$\displaystyle \displaystyle{\int e^{3x}\cos(x)\,dx=e^{3x}\sin(x)-3\int e^{3x}\sin(x)\,dx.}$

Again, let $\displaystyle u=e^{3x},$ from which we get that $\displaystyle du=3e^{3x}\,dx$. This time, let $\displaystyle dv=\sin(x)\,dx$, and thus it is that $\displaystyle v=-\cos(x)$. Our equation becomes

$\displaystyle \displaystyle{\int e^{3x}\cos(x)\,dx=e^{3x}\sin(x)-3\left(-e^{3x}\cos(x)+3\int e^{3x}\cos(x)\,dx\right).}$

Therefore,

$\displaystyle \displaystyle{\int e^{3x}\cos(x)\,dx=e^{3x}\sin(x)+3 e^{3x}\cos(x)-9\int e^{3x}\cos(x)\,dx.}$ Hence,

$\displaystyle \displaystyle{10\int e^{3x}\cos(x)\,dx=e^{3x}\sin(x)+3 e^{3x}\cos(x),}$ and thus

$\displaystyle \displaystyle{\int e^{3x}\cos(x)\,dx=\frac{1}{10}\,e^{3x}\sin(x)+\fra c{3}{10}\, e^{3x}\cos(x).}$

Going back to the equation from whence we needed this integral, we have the following:

$\displaystyle \displaystyle{e^{3x}y-C=2\int e^{3x}\cos(x)\,dx=2\left(\frac{1}{10}\,e^{3x}\sin( x)+\frac{3}{10}\, e^{3x}\cos(x)\right)=\frac{1}{5}\,e^{3x}\sin(x)+\f rac{3}{5}\, e^{3x}\cos(x)}.$

It follows, then, that

$\displaystyle \displaystyle{e^{3x}y=\frac{1}{5}\,e^{3x}\sin(x)+\ frac{3}{5}\, e^{3x}\cos(x)+C},$ and thus

$\displaystyle \displaystyle{y(x)=\frac{1}{5}\,\sin(x)+\frac{3}{5 }\,\cos(x)+Ce^{-3x}.}$

Check:

$\displaystyle \displaystyle{y'+3y=\frac{1}{5}\,\cos(x)-\frac{3}{5}\,\sin(x)-3Ce^{-3x}+\frac{3}{5}\,\sin(x)+\frac{9}{5}\,\cos(x)+3Ce^ {-3x}=2\cos(x),}$

as required. In comparing this with your solution, I think you dropped the original RHS 2 somewhere.

Suggestion: don't skip lots of steps! You can see in my solution that I don't skip a lot of steps.

2. Instead of posting the entire solution, I think I know where part of your problem is: in your integration by parts the first time: integrating $\displaystyle dv=\cos(2x)\,dx$. You should get

$\displaystyle \displaystyle{v=\frac{\sin(2x)}{2}}$. You've done this correctly before, but not the second time you posted a solution to this problem.

So carry that through, and check your answer by differentiating to make sure it satisfies the original DE! That's very important.

7. oh ic now

My problem was that in both question i included the constant in my integration by parts. This is what i mean

$\displaystyle e^{3x}y=2\int e^{3x}cos(x)$
meant to be
$\displaystyle \int e^{3x}cos(x) = e^{3x}sin(x)-3\int e^{3x}sin(x)$
not
$\displaystyle 2\int e^{3x}cos(x) =e^{3x}sin(x)-3\int e^{3x}sin(x)$

i included the two which meant the next integration by parts i was going to 9+2 on the LHS.

This was the same problem with the other question as well.

8. So, all clear now?

9. yep

10. Great! Have a good one.