# Solve $\int{x\sin^2(x)}\ dx$

I need to solve this integral: $$\int{x\sin^2(x)}\ dx$$

I SOLVED it by writting: $$\sin^2(x) = \frac{1-\cos(2x)}{2}$$ and used integration by parts for $x\cos(2x)$, and the result is:

$$\frac{1}{4}(x^2-x\sin(2x)-\frac{\cos(2x)}{2}) + C$$

I need to know other methods of solving this integral (preferable simple methods). Thank you!

• $\int x \sin^2(x) dx = \frac{1}{2} \int (x-x\cos(2x)) dx$ Use integration by parts on the $x\cos(2x)$. – bigfocalchord Jul 19 '16 at 12:23
• Integration by parts. – MathsPro Jul 19 '16 at 12:23
• @dydxx I used that method, I want to know other methods. Check my question. – MM PP Jul 19 '16 at 12:24
• Do you specifically want to avoid integration by parts? – user 170039 Jul 19 '16 at 12:28
• @user170039 No. I just want different methods of solving this. I used the method I added in the question, but I want to know as many methods as possible. Thank you. – MM PP Jul 19 '16 at 12:29

Hint:- Let $$I=\displaystyle\int x\sin^2 x\ dx$$$$J=\displaystyle\int x\cos^2 x\ dx$$Now observe that, $$I+J=\displaystyle\int x\ dx$$and $$I-J=\Re\left(\displaystyle\int xe^{2ix}\ dx\right)$$where $\Re\left(\displaystyle\int xe^{2ix}\ dx\right)$ denotes the real part of the integral.
Although this is a more complicated sotution way ,but different from your method $$\int { x\sin ^{ 2 } (x) } dx=\int { \sin ^{ 2 } (x)d\left( \frac { { x }^{ 2 } }{ 2 } \right) =\frac { { x }^{ 2 }\sin ^{ 2 } (x) }{ 2 } } -\frac { 1 }{ 2 } \int { { x }^{ 2 }\sin { 2x } dx } =\\ =\frac { { x }^{ 2 }\sin ^{ 2 } (x) }{ 2 } +\frac { 1 }{ 4 } \int { { x }^{ 2 }d\cos { 2x } =\frac { { x }^{ 2 }\sin ^{ 2 } (x) }{ 2 } +\frac { 1 }{ 4 } \left( { x }^{ 2 }\cos { 2x } -2\int { x\cos { 2xdx } } \right) = } \\ =\frac { { x }^{ 2 }\sin ^{ 2 } (x) }{ 2 } +\frac { 1 }{ 4 } \left( { x }^{ 2 }\cos { 2x } -\int { xd\sin { 2x } } \right) =\frac { { x }^{ 2 }\sin ^{ 2 } (x) }{ 2 } +\frac { 1 }{ 4 } \left( { x }^{ 2 }\cos { 2x } -x\sin { 2x+\int { \sin { 2xdx } } } \right) =\\ =\frac { { x }^{ 2 }\sin ^{ 2 } (x) }{ 2 } +\frac { { x }^{ 2 }\cos { 2x- } x\sin { 2x } }{ 4 } -\frac { 1 }{ 8 } \cos { 2x } +C$$
$$f(x)=\int x\sin(x)^2dx$$ $$f(x)=-\frac 14\int x\left(e^{2ix}+e^{-2ix}-2\right)dx$$
$$f(x)=-\frac 14\left(\frac x{2i}e^{2ix}+\frac 14 e^{2ix}-\frac x{2i}e^{-2ix}+\frac 14e^{-2ix}-x^2\right)+C$$