Analogue of the dot product for functions I have been reading some articles and I see that there is an analogue of the dot product for functions in the form of an integral. However, I am confused by the fact that there seems to be 2 forms: 


*

*$\int f_1(x)f_2(x)dx$

*$\int w(x)f_1(x)f_2(x)dx$ where $w(x)$ is called the weight function


What is going on? Perhaps the 1st case is a special case of the second where the weight function equals 1? When do you need the weight function? 
Thanks.
 A: Expanded summary of comments: 


*

*Yes, the first inner product is a special case of the second, with $w\equiv 1$

*There are multiple reasons to consider spaces with weighted inner product (called weighted $L^2$ spaces): 

*

*Polynomials are not square integrable on unbounded intervals $I$ such as $\mathbb R$ or $[0,\infty)$. If one wishes to have an orthogonal basis of polynomials on $L^2(I)$, a weight must be used. Two popular weights are $\exp(-x^2)$ and $\exp(-x)$. 

*Even on a bounded interval, polynomials with interesting properties (such as Chebyshev polynomials $T_n$ on $[-1,1]$) happen to be orthogonal with a weight different from $1$. 

*Eigenfunctions of a differential equation with nonconstant coefficients tend to be orthogonal with respect to weights related to the coefficients. 




Is there any meaning to the question: "Given 2 functions $f(x)$ and $g(x)$, determine whether they are orthogonal." (with no additional information)?

Without any context, this is an unacceptably vague question. If I had to guess, I'd say  that the inner product $\int_D fg$ should be used, where $D$ is the intersection of domains of $f$ and $g$.
