How do I go about finding the terms of the Fourier series of some $f(x)$ with respect to an orthogonal set? For instance, if we wanted to find the Fourier series of $f(x) = |x|$ on $(-1, 1)$ with respect to the Legendre polynomials $P_n(x)$?
I know that the generalised Fourier series of some function $f(x) $with respect to some set of orthogonal functions $\{ \phi_k \}^\infty_{n = 0}$ is
$$f(x) = \sum_{k = 0}^\infty c_k \phi_k (x)$$
So what is the process then? I have a suspicion that the inner product is involved?
I would greatly appreciate it if people could please take the time to explain this.
Hint: consider $$\int f(x)\phi_m^*(x)dx$$and use orthogonality since $$\int \phi_n(x)\phi_m^*(x)dx=\delta_{m-n}$$