# Thread: help with this integral

1. ## help with this integral

integral of x sin^2x dx

and would you show me the proceedure please?

2. Originally Posted by yasu7
integral of x sin^2x dx

and would you show me the proceedure please?
Parts!

$\sin^2(x) = \frac{1}{2} - \frac{1}{2}\cos(2x)$

Hence

$\int x \sin^2(x) dx = \int x\bigg( \frac{1}{2} - \frac{1}{2}\cos(2x) \bigg)dx = \frac{1}{2}\int x - x \cos(2x) dx$

The first term is easily integrated, and the 2nd term is integrated by parts.

$\int x \cos(2x) dx = \bigg(\frac{x \sin(2x)}{2}\bigg) - \int \frac{\sin(2x)}{2}dx$

3. I've got the answer, and it is like this:
$1/8(2x^2-2xsin2x-cos2x) + c$

could someone help me get to this?

4. Originally Posted by yasu7
I've got the answer, and it is like this:
$1/8(2x^2-2xsin2x-cos2x) + c$

could someone help me get to this?
$\sin^2(x) = \frac{1}{2} - \frac{1}{2}\cos(2x)$

Hence the integral becomes:

$\int x \sin^2(x) dx = \int x\bigg( \frac{1}{2} - \frac{1}{2}\cos(2x) \bigg)dx = \frac{1}{2}\int x - x \cos(2x) dx$.

This can be split into two integrals as such:

$= \frac{1}{2}\int x dx - \frac{1}{2}\int x \cos(2x) dx$

The first integral can be calculated easily using the rule that $\int x^n dx = \frac{x^{n+1}}{n+1} +C$. The second integral must be evaluated by parts:

First Integral

$= \frac{1}{2}\bigg(\frac{x^2}{2}\bigg)$

Second Integral

$\frac{1}{2}\bigg(x \frac{\sin(2x)}{2}\bigg) - \frac{1}{2} \int \frac{\sin(2x)}{2}dx$

$= x \frac{\sin(2x)}{4} +\bigg(\frac{1}{2} \frac{\cos(2x)}{4}\bigg)dx$

$= x \frac{\sin(2x)}{4} +\frac{\cos(2x)}{8} +C$

Total Integral = First Integral - Second Integral

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

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

Take out a factor of $\frac{1}{8}$

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

5. I don't get where does the $\frac{1}{2}\int\frac {sin(2x)}{2}$ comes from,

is that a rule or something? thanks in advance

6. Originally Posted by yasu7
I don't get where does the $\frac{1}{2}\int\frac {sin(2x)}{2}$ comes from,

is that a rule or something? thanks in advance
Yes, it's called integration by parts.

$\int f(x)g'(x) = g(x)f(x) - \int g(x)f'(x) dx$

In your case $f(x) = x$ and $g'(x) = \cos(2x)$

So $f'(x) = 1$ and $g(x) = \int g'(x)dx = \int(\cos(2x))dx = \frac{\sin(2x)}{2}$

Put it all together and you get:

$\int x \times \cos(2x) dx = \bigg(\frac{\sin(2x)}{2} \times x \bigg) - \int \bigg(\frac{\sin(2x)}{2} \times 1\bigg) dx$