How can I change the variable in this integral? I have the following equality 
$\int_{0}^{\pi}cos(nt)cos(mt)dt=0$ (if $m\neq n$)
This is in the context of Chebyshev polynomials and the book states the following to deduce ortoghonality.
"the orthogonality property is drawn by using the substitution t = arcos(x) in the interval [-1,1] relative to the weight function $(1-x^2)^{-\frac{1}{2}}$, which is verified by the system of polynomials {Tn(x)}:"
$\int_{-1}^{1}Tn(x)Tm(x)dt=0$,  (if m $\neq$ n)
Can anybody explain (or point me to an example) how to do the above variable change in the initial integral and where does the weight function come from?

It seems that you start from the result
$\int_{\theta = 0}^{\theta = \pi}$ $cos(m \theta) cos(n \theta) d\theta = 0$ for $m \ne n$
Then if you use the suggested transformations and the property that $T_n(cos(\theta)) = cos(n \theta)$ you should be able to get
$\int_{x=-1}^{x=+1} T_m(x) T_n(x) \frac{1}{\sqrt{1-x^2}}dx= 0$ for $m \ne n$.
The factor $\frac{1}{\sqrt{1-x^2}}$ is the weight function.
