# How do you find the integral of sinpixcospix dx?

Feb 7, 2015

For this integral, you should recall that $\setminus \sin \left(2 x\right) = 2 \setminus \sin \left(x\right) \setminus \cos \left(x\right)$. So, if you multiply the sine and cosine function evaluated in the same point, dividing by two the relation above, you can check that
$\frac{\setminus \sin \left(2 x\right)}{2} = \setminus \sin \left(x\right) \setminus \cos \left(x\right)$.

In your case, instead of $x$ you have $\setminus \pi x$, so the relations becomes
$\setminus \sin \left(\setminus \pi x\right) \setminus \cos \left(\setminus \pi x\right) = \frac{\setminus \sin \left(2 \setminus \pi x\right)}{2}$, which is much easier to integrate. In fact,
$\setminus \int \frac{\setminus \sin \left(2 \setminus \pi x\right)}{2} = \frac{1}{2} \setminus \int \setminus \sin \left(2 \setminus \pi x\right)$
let $t$ be the new variable:
$t = 2 \setminus \pi x \setminus R i g h t a r r o w x = \frac{t}{2 \setminus \pi} \setminus R i g h t a r r o w \mathrm{dx} = \frac{\mathrm{dt}}{2 \setminus \pi}$

The integral becomes
$\frac{1}{2} \setminus \int \setminus \sin \left(t\right) \frac{\mathrm{dt}}{2 \setminus \pi}$, and factoring out constants again we get
$\frac{1}{4 \setminus \pi} \setminus \int \setminus \sin \left(t\right) \mathrm{dt} = - \setminus \cos \frac{t}{4 \setminus \pi} + C$
Recalling the relation between $t$ and $x$, the answer is finally
$- \setminus \cos \frac{2 \setminus \pi x}{4 \setminus \pi} + C$

Mar 10, 2015

One method gives correct answer: $- \setminus \cos \frac{2 \setminus \pi x}{4 \setminus \pi} + C$

A different method gives an answer that looks different:

$\int \sin \left(\pi x\right) \cos \left(\pi x\right) \mathrm{dx}$

Since d(sin t) =cos t dt, substitution will work:

Let $u = \sin \left(\pi x\right)$, then $\mathrm{du} = \pi \cos \left(\pi x\right) \mathrm{dx}$ And $\cos \left(\pi x\right) = \frac{\mathrm{du}}{\pi}$.

Substituting yields:

$\frac{1}{\pi} \int \sin u \mathrm{du} = \frac{1}{\pi} \frac{{\sin}^{2} u}{2} + C$

So
$\int \sin \left(\pi x\right) \cos \left(\pi x\right) \mathrm{dx} = \frac{1}{2 \pi} {\sin}^{2} \left(\pi x\right) + C$

The answer look different, but what is the difference?
Hint: subtract and simplify.

$\frac{1}{2 \pi} {\sin}^{2} \left(\pi x\right) - \left(- \setminus \cos \frac{2 \setminus \pi x}{4 \setminus \pi}\right)$
$= \frac{1}{2 \pi} {\sin}^{2} \left(\pi x\right) + \frac{1}{4 \pi} \cos \left(2 \pi x\right)$
$= \frac{1}{2 \pi} {\sin}^{2} \left(\pi x\right) + \frac{1}{4 \pi} \left[1 - 2 {\sin}^{2} \left(\pi x\right)\right]$
$= \frac{1}{4 \pi}$

The difference is a constant! The two solutions have different $C$'s.