# Using dummy variable to derive Nth partial Fourier sum

I am working on a problem$^{(1)}$ as follow:

Using the standard formulas for the Fourier coefficients, show

$$F_N(x) = \frac1{2\pi} \int_{-\pi}^{\pi} \left( 1+2 \sum_{n=1}^{N} \cos(ny)\cos(nx) + \sin(ny) \sin(nx) \right) f(y) dy,$$

where $F_N(x)$ is the $N$th partial Fourier sum, and $f(x)$ is on $-\pi < x < \pi$. Hint: Use a dummy variable integral.

For your convenience of copying and pasting, here are the full Fourier series formulas for $f(x)$ on $-l < x < l$:

\begin{align} f(x) &= \frac12 a_0 + \sum_{n=1}^{\infty} \left[ a_n \cos (\frac{n\pi x}{a}) + b_n \sin(\frac{n\pi x}{l})\right], \tag{a}\\ a_n &= \frac{1}{l} \int_{-l}^{l} f(x) \cos (\frac{n\pi x}{l}) dx, \tag{b}\\ b_n &= \frac{1}{l} \int_{-l}^{l} f(x) \sin (\frac{n\pi x}{l}) dx. \tag{c} \end{align}

Here are what I did so far:
(1) For $n = 0$ and $l = \pi$, $$a_0 = \frac1{\pi} \int_{-\pi}^{\pi} f(x) dx$$

(2) And then plug in $a_0, a_n, b_n$ into (a),

\begin{align} F_N(X) = \frac1{2\pi} \int_{-\pi}^{\pi} f(x)dx &+ \sum_{n=1}^{N} \left[\frac1{\pi}\cos(nx) \int_{-\pi}^{\pi}f(x) \cos(nx)dx + \frac1{\pi}\sin(nx) \int_{-\pi}^{\pi}f(x) \sin(nx)dx\right] \end{align}

(3) $\ldots$

But after this second step I am not sure on how to use dummy variable to come up with the $f(y)$ and $dy$. I would appreciate any help or pointers.

Thank you for your time and tedious typing :-).

Footnote: (1) Introduction to Applied PDE by John Davis, Exercise 8(a), page 111.

Before step (2) change all integration variables to $y$. Since they are bound to the integral, changing them is just a technicality. Not doing this is a bad idea, since the formula in step (2) contains $x$ in two different roles.