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?

From $$\int_{0}^{\pi}\cos(nt)\cos(mt)dt=0,\qquad m\neq n$$ you may perform the change of variable
$$
t= \text{arcos}(x), \qquad dt=-\frac{1}{\sqrt{1-x^2}},
$$ giving
$$\int_{-1}^{1}T_n(x)T_m(x)dt=0,\qquad m\neq n.$$
