Confused about an integration simplification

65 Views Asked by At

$$a_n=\frac{1}{\pi}\left[-\int_{-\pi}^0\sin(x)\cos(nx)\,dx+\int_0^{\pi}\sin(x)\cos(nx)\,dx\right]$$ More convenient to write $$a_n=\frac{2}{\pi}\int_0^{\pi}\sin(x)\cos(nx)\,dx.$$

I am confused as to how that the first half of the integral equals the second half.

If I flip the limits, that get rids of the negative sign of the first integral, however the limits are not the same so I can't add them. If I flip the signs of the limit, wouldn't the minus sign be reintroduced leading to 0? (I know that is wrong I just don't know why)

Thank you.

1

There are 1 best solutions below

3
On BEST ANSWER

We do a change of variables in the first integral; let $x'=-x$, then $$\int_{-\pi}^0 -\sin(x)\cos(nx)d x = \int_{-\pi}^0\sin(-x)\cos(-nx)d x \\= -\int_{\pi}^0 \sin(x')\cos(nx')dx' = \int_0^{\pi}\sin(x')\cos(nx')d x'$$ So this integral is in fact equal to the other one: $$a_n = \frac{1}{\pi}\left(\int_0^\pi \sin(x)\cos(nx)d x + \int_0^\pi \sin(x)\cos(nx)d x \right) = \frac{2}{\pi}\int_0^\pi\sin(x)\cos(nx)d x$$