To compute the generalized Fourier Series of a function, the formula is $c_n = \frac{<f(x),\ \phi_n(x)>_{w(x)}}{<\phi_n(x),\ \phi_n(x)>_{w(x)}}$, where the numerator and denominator are each weighted inner products with respect to the same weight $w(x)$. However, the problems in my book explicitly give values for $f(x)$ and $\phi_n(x)$, but not for $w(x)$, and ask for the series to be computed. In most cases, the examples and exercise answers seem to either assume or assert that $w(x) = 1$.
Surely $w(x)$ is not always $1$, or there would be no need to introduce weighted inner products instead of using ordinary inner products. Where does the value of the weight come from? Is it supposed to be dictated by the problem statement, or computed from the problem somehow (i.e., a PDE separation of variables problem)? If it's the latter, then how can I compute the weight function?