Suppose the trigonometric Fourier coefficients are defined in the usual way as $$a_n=\frac{1}{\pi}\int_{- \pi}^\pi f(x)\cos(nx)dx \qquad \text {&} \qquad b_n=\frac{1}{\pi}\int_{- \pi}^\pi f(x)\sin(nx)dx\tag{a}$$ on the interval $[-\pi,\pi ]$ and the length of the interval ($2\pi$) changes to $2\ell$ where $\ell \gt 0$.
All the textbooks I have checked just state the answer is $$a_n=\frac{1}{\ell}\int_{- \ell}^\ell f(x)\cos\left(\frac{n\pi x}{\ell}\right)dx \qquad \text {&} \qquad b_n=\frac{1}{\ell}\int_{- \ell}^\ell f(x)\sin\left(\frac{n\pi x}{\ell}\right)dx\tag{b}$$
What transformation took place to convert the integrals in $(\mathrm{a})$ to the integrals in $(\mathrm{b})$? More specifically; in the argument of the sines and cosines why does $nx \to \dfrac{n\pi x}{\ell}$? Since the interval is now of length $2 \ell$ why is the factor out front not $\dfrac{1}{2\ell}$?
I realise that this is a lot of questions, so if anyone could answer even one of them it will be greatly appreciated. I can't show my efforts at trying to answer the question (the prerequisite) since I am stuck at the very start.
It's no big secret!
Assume that $t\mapsto g(t)$ is a periodic function of period $2\ell>0$. Then the function $$f(x):=g\left({\ell \over\pi}x\right)$$ is a function of period $2\pi$ (check this!). Therefore the function $f$ has Fourier cosine coefficients $$a_n={1\over\pi}\int_{-\pi}^\pi f(x)\cos(n x)\>dx={1\over\pi}\int_{-\pi}^\pi g\left({\ell\over\pi}x\right)\cos(n x)\>dx={1\over\ell}\int_{-\ell}^\ell g(t)\cos\left({n \pi t\over\ell}\right)\>dt\ ,$$ whereby we have used the substitution $x:={\pi \over\ell}t\>$; and similarly for the sine coefficients.
Furthermore, under favorable circumstances we have $$f(x)={a_0\over2}+\sum_{n=1}^\infty\bigl(a_n\cos(nx)+b_n\sin(nx)\bigr)\ .$$ It follows that $$g(t)=f\left({\pi\over\ell} t\right)={a_0\over2}+\sum_{n=1}^\infty\left(a_n\cos\left({n \pi t\over\ell}\right)+b_n\sin\left({n \pi t\over\ell}\right)\right)\ .$$