Changing the length of an interval for the Fourier coefficients 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.
 A: 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)\ .$$
A: Edit
Please, if you do not understand sth. ask it again, but think about this first please:
How do you choose $c$ in order to achieve
$$\int_0^T \sin(cnx)\sin(cmx)dx=0$$
for $m\neq n$ being $n,m\in\mathbb{N}$
You need orthogonal functions of perior $T$. Do you know now the relationship?
Original answer
The problem is that you want to understand it from the end instead of from the beginning.
Think this. Let $f$ be an odd function i.e.  $f(x)=-f(-x)$. The orthogonal basis that forms a complete space for odd functions is:
$$\{\sin(nx)\}, \quad n=1,2,3,...$$
In the interval $[-\pi,\pi]$ or between 2 points separated by $T=2\pi$.
It is important for you to keep in mind that the functions forming this basis are orthogonal only in this kind of interval. Therefore they would be used to expand $f$ only within this interval, and since these functions are periodic, it will repeat itself in all intervals shifted provided that its length is $2\pi$.
If $f$ is expanded then:
$$f(x)=\sum c_n\sin(nx) \tag{*}$$
Since the scalar product $(\sin(nx),\sin(mx))=0$ for $n\neq m$ we can multiply the expression $(*)$ by $\sin(mx)$ to obtain $c_n$
$$(f(x),\sin(nx))=c_n(\sin(nx),\sin(nx))$$
You have now:
$$c_n=(f(x),\sin(nx))/(\sin(nx),\sin(nx))$$
Now if you want to extend the basis to an arbitrary period $T$, to expand the function $f$ in this interval, the basis changes accordingly:
$$\{\sin(nx)\}\rightarrow \{\sin(nx2\pi/T)\}$$
Check that this new basis is orthogonal in the interval $[0,T]$ or $[-T/2,T/2]$ or whatever shifted provided that its length is equal to $T$.
Therefore the function $f$ may be expanded in this new basis:
$$f(x)=\sum c_n\sin(2\pi nx/T) $$
Repeat the procedure described before and you will find new expressions for $c_n$.
