# 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) $y'+3y=2cosx$
$I=e^{3x}$
$e^{3x}(y'+3y)=2e^{3x}cos(x)$
$e^{3x}y=2\int e^{3x}cos(x) dx$

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

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

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

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

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

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

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

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

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

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

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

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

$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}]
$

$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)
$

$\frac{29}{4}\int e^{3x}cos(2x)=\frac{1}{2}e^{3x}sin(2x)-\frac{3}{4}e^{3x}$

$\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:
$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)
$e^{3x}=\int 2e^{3x}cos(x)$
$u=2e^{3x}$ $du=6e^{3x}$

$dv=cos(x)$ $v=sin(x)$

$\int 2e^{3x}cos(x) = 2e^{3x}sin(x) - 6\int e^{3x}sin(x)$
$u=e^{3x}$ $du=3e^{3x}$

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

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

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

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

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

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

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

$\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)$

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

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

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

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

$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. $y'+3y=2\cos(x).$

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

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

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

Here I have used the $-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 $u=e^{3x}$. Then $du=3\,e^{3x}\,dx.$ Let $dv=\cos(x)\,dx$. Then $v=\sin(x)$. It follows, then, that

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

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

$\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{\int e^{3x}\cos(x)\,dx=e^{3x}\sin(x)+3 e^{3x}\cos(x)-9\int e^{3x}\cos(x)\,dx.}$ Hence,

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

$\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{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{e^{3x}y=\frac{1}{5}\,e^{3x}\sin(x)+\ frac{3}{5}\, e^{3x}\cos(x)+C},$ and thus

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

Check:

$\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 $dv=\cos(2x)\,dx$. You should get

$\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

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

not
$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.