I must find the Fourier serie of $$\phi(x)=x-\frac{1}{2}$$ on $[0,1]$, knowing that the Fourier series of $f(x)=x$ is : $$\sum_{k=1}^{\infty}\frac{2(-1)^{k+1}\sin(kx)}{k}$$ The solution of this problem is :
on $[0,1]$, the Fourier coefficient is : $$a_k=\int_{0}^{1}\phi(x)e^{-2ik\pi x}dx$$ and the functions $e^{-2ik\pi x}, k \in Z$ form a orthonormal basis of $L^1([0,1])$. We set $x=2\pi(y-1/2)$, and the Fourier transform of
$$\sum_{k=1}^{\infty}\frac{2(-1)^{k+1}\sin(k2\pi(y-1/2))}{k}$$ Hence the Fourier transform of $\phi$ is : $$-\sum_{k=1}^{\infty}\frac{\sin(2\pi k y)}{\pi k}$$
I don't understand this solution. First, how do we know that the Fourier coefficient $a_k$ is like this ? Then, why do we set a change of variable ? Thanks for your help !