Q:

Proving that $\langle f, g\rangle = \sum_n \langle f, \phi_n \rangle \overline{\langle g, \phi_n \rangle}$

I have the following problem to solve: 

If the set of functions $\{\phi_n \}_1^\infty$ is an orthonormal basis in
  $L^2(a,b)$ and the functions $f, g \in L^2(a,b)$, then show that: 
$$\langle f, g\rangle = \sum_n \langle f, \phi_n \rangle
 \overline{\langle g, \phi_n \rangle}.$$

The dot product $\langle f, g\rangle$ is defined as:
$$\langle f, g \rangle = \int_a^b f(x)\overline{g(x)}\;dx.$$
Because $f, g \in L^2(a,b)$, we have: 
$$f= \sum_n \langle f, \phi_n\rangle \phi_n \;\;\;\text{and}\;\;\;g= \sum_n \langle g, \phi_m\rangle \phi_m.$$
Here is my attempt: 
$$\langle f, g\rangle = \int_a^bf(x)\overline{g(x)}\;dx = \int_a^b \left( \sum_n \langle f, \phi_n\rangle \phi_n(x)\right)\left( \overline{\sum_m\langle g, \phi_m\rangle \phi_m(x)}\right) \;dx$$
$$= \int_a^b \left( \sum_n \langle f, \phi_n\rangle \phi_n(x)\right)\left( \sum_m \overline{\langle g, \phi_m\rangle \phi_m(x)}\right) \;dx = \int_a^b\left( \sum_n \int_a^b f(y)\overline{\phi_n(y)}\;dy\;\phi_n (x)\right)\left( \sum_m \int_a^b \overline{g(z)}\phi_m(z)\;dz\;\overline{\phi_m(x)} \right)\;dx$$
$$?=\sum_n \langle f, \phi_n\rangle\overline{\langle g, \phi_n\rangle} = \sum_n\int_a^bf(x)\overline{\phi_n(x)}\;dx\int_a^b\overline{g(y)}\phi_n(y)\;dy$$
So should the last and third line be equal? Thnx for any hints
UPDATE: 
I think I got it by the hint given to me =) : 
$$\langle f, g\rangle = \int_a^bf(x)\overline{g(x)}\;dx = \int_a^b \left( \sum_n \langle f, \phi_n\rangle \phi_n(x)\right)\left( \overline{\sum_m\langle g, \phi_m\rangle \phi_m(x)}\right) \;dx$$
$$=\int_a^b \sum_{n,m}\langle f, \phi_n \rangle\overline{\langle g, \phi_m\rangle}\phi_n(x)\overline{\phi_m(x)} \;dx= \int_a^b \sum_n \langle f, \phi_n \rangle\overline{\langle g, \phi_n\rangle}\phi_n(x)\overline{\phi_n(x)}\;dx$$
$$= \sum_n \langle f, \phi_n \rangle\overline{\langle g, \phi_n\rangle}\int_a^b \phi_n(x)\overline{\phi_n(x)}\;dx = \sum_n \langle f, \phi_n \rangle\overline{\langle g, \phi_n\rangle}\langle \phi_n, \phi_n\rangle = \sum_n \langle f, \phi_n \rangle\overline{\langle g, \phi_n\rangle}\;\;\blacksquare$$

A:

By the properties of $\Phi_n$,
$$f=\sum_n\langle f,\phi_n\rangle \phi_n $$
and $$\langle \phi_n,\phi_m\rangle =\delta_{m,n}.$$

