AravindG 2 years ago integral (e^x(xcos x+sin x))dx=?

1. AravindG

$\large \int\limits e^x(xcos x+\sin x)dx$

2. AravindG

I have been stuck on this question for sometime..I am missing something somewhere.

3. AravindG

@ganeshie8 , @jim_thompson5910 Can you help?

4. divu.mkr

its a case in integration of by parts!!

5. surjithayer

$=\int\limits (x \cos x) e ^{x} dx+\int\limits (\sin x) e ^{x}dx$ $=x \cos x e ^{x}-\int\limits \left\{ x \left( -\sin x \right)+\cos x *1 \right\}e ^{x} dx+\[\sin x e ^{x}-\int\limits \cos x e ^{x}dx$+c\] there is some mistake,try to find out.

6. AravindG

I am thinking of doing it in the form e^x(f(x)+f'(x)) By supplying terms and subtracting.

7. surjithayer

i have tried that also.

8. AravindG

@surjithayer How did you get integral (xcos x)e^x dx=(xcos x)(e^x)

9. AravindG

I am confused :/

10. divu.mkr

you are doing that right and its integration is e^x.f(x)+c

11. AravindG

@divu.mkr can you explain?

12. Euler271

everything i wrote is gone

13. AravindG

How??

14. Euler271

it all ends up being in terms of:$\int\limits_{}^{}e^x cosx dx= \frac{ 1 }{ 2 }e^x(sinx + cosx) + C$ and$\int\limits_{}^{}e^x sinx dx= \frac{ 1 }{ 2 }e^x(sinx - cosx) + C$. a rather simple integration by parts. and seperating it like surji suggested and integrating only the first term by parts one gives:$\frac{ x }{ 2 }e^x(sinx+cosx) - \frac{ 1 }{ 2 }\int\limits_{}^{} e^x (sinx + cosx)dx + C + \int\limits_{}^{}e^x sinx dx$

15. Euler271

was my own fault. i pressed a wrong key and then backspace

16. Euler271

once**

17. AravindG

Isnt it e^x (xcos x)?

18. Euler271

the integral of that, by parts once, gives the first two terms of the last line. taking u = x dv = e^xcosx

19. Euler271

i wouldn't mind solving it entirely if you're not convinced :)

20. AravindG

21. AravindG

Its just I want to to do this qn in form e^x((fx)+f'(x)) Format and not apply parts.

22. Euler271

i'm not familiar with that method at all. only parts

23. Euler271

did you want to see parts or you know how?

24. AravindG

yeah I want to see parts.

25. Euler271

i guess the only part is the:$\int\limits_{}^{} e^x cosx dx$ u = e^x; du = e^x dx dv = cosx dx; v = sinx $\int\limits_{}^{} e^x cosx dx = e^xsinx - \int\limits_{}^{} e^x sinx dx$ u = e^x; du = e^x dx dv = sinx dx; v = -cosx $\int\limits_{}^{}e^x cosx dx= e^x sinx - \left( -e^x cosx + \int\limits_{}^{}e^x cosxdx \right)$ $\int\limits_{}^{}e^x cosx dx = e^x(cosx + sinx) - \int\limits_{}^{}e^x cosx dx$$2\int\limits_{}^{}e^x cosx dx = e^x(sinx + cosx)$$\int\limits_{}^{}e^x cosx dx = \frac{ 1 }{ 2 }e^x (sinx + cosx)$

26. divu.mkr

do you have the answer..? i got one :D

27. AravindG

yes final answer is 1/2e^x(xsin x+xcos x-cos x)+c

28. AravindG

@Euler271 Yeah I get it now thanks!

29. Euler271

30. surjithayer

i have tried that also.

31. ybarrap

Lots of integration by parts. Work on this in pieces (I've reused u and v several times but hopefully you can tell which is which by context): $$\int e^x(x\cos x+\sin x)dx\\ \int xe^x \cos x ~dx+\int xe^x \sin x~dx\\ \text{For }\int xe^x \cos x ~dx\\ \text{Let }u=x,dv=e^x\cos x\\du=x,v=\int e^x\cos x dx\\ \text{For }\int e^x\cos x dx\\ \text{Let }u=e^x,dv=\cos x\\ du=e^x,v=\sin x\\ \text{Then }uv-\int vdu=\\ e^x\sin x-\int e^x\sin x dx\\ \int e^x\sin x dx=\\ \text{Let }u=e^x,dv=\sin x\\ \text{then }du=e^x,v=-\cos x\\ uv-\int vdu = \\ -e^x\cos x+\int e^x\cos x dx\\ \text{Combining these results:}\\ \int e^x\cos x=\cfrac{e^x}{2}(\sin x+\cos x)\\ \text {So we now have }\\ \int xe^x \cos x ~dx\\ =\cfrac{xe^x}{2}(\sin x + \cos x)-\int \cfrac{e^x}{2}(\sin x + \cos x)dx+\\ \qquad \cfrac{e^x}{2}(\sin x - \cos x)\\ \text{Take, }\int\frac{e^x}{2}(\sin x + \cos x)dx\\ \int\frac{e^x}{2}\sin x + \int \cfrac{e^x}{2}\cos xdx\\ =\cfrac{e^x}{4}(\sin x -cos x)+\cfrac{e^x}{4}(\sin x +cos x)\\ =\cfrac{e^x}{2}\sin x\\ \text{So, }\\ \int xe^x \cos x ~dx\\ =\cfrac{xe^x}{2}(\sin x + \cos x)-\cfrac{e^x}{2}\sin x+\cfrac{e^x}{2}(\sin x - \cos x)\\ =\cfrac{e^x}{2}(x\sin x + (x-1)\cos x)\\$$ Whew!! That's it!