# Weighted inner product of functions

I am facing difficulty understanding the requirement of the weighted inner product. As per my understanding, the inner or dot product is just the projection of one vector onto another and also gives the angle between them for vector spaces, or it is the integral of the product of two arbitrary functions continuous and differentiable within the interval (a,b) for the function spaces. And analogically I can relate the meaning of orthogonality of functions with the vectors when the integral is zero.$$=\int_a^b f(x)g(x)dx$$

But why do we need the integral of the form $$I=\int_a^b w(x)f(x)g(x)dx$$for the inner product of the functions? As per my understanding, I think of it as something similar to the weighted integral statement in Finite Element Analysis where we provide weight to one function (i.e. scale the function values at different 'x' with w(x) ) and then integrate.

But neither am I able to interpret the meaning of the weighted inner product physically nor do I understand why the former inner product is not enough that we needed to define weighted inner product? Any help would be appreciated.

Also,let's say that the functions f(x) and g(x) are orthogonal with respect to weight function w(x) i.e. integral$$I=0$$then f(x) and g(x) are not actually orthogonal (or linearly independent if I speak in analogy with orthogonal eigenvector) right? Then how and why can we express any function as the linear combination of f & g which are orthogonal with respect to w(x) only? Why does f and g still form a basis?

• The weighted inner product is important because one might wish to project a function onto a basis which is orthogonal with respect to a weighted inner product . Orthogonality is nice because it enables one to determine the basis coefficients without solving a linear system.
– Doug
Jul 26, 2022 at 14:41
• Can you please explain what is meant by orthogonal with respect to a weighted inner product? Jul 26, 2022 at 15:45
• orthogonal meaning $<f_n,f_m> = \delta_{n,m}$, where $f_n$ are the basis functions.
– Doug
Jul 26, 2022 at 15:57
• I liked this explanation
– Babu
Jul 28, 2022 at 8:08

The weight function has large values for those $$x$$ which are significant for the application you have in mind. Taking $$x$$ to be "frequency" for example, you might want to determine how similar two signals with spectra (fourier transform) $$f$$ and $$g$$ are, but your application requires that for some region of $$[a,b]$$ the similarity is more important and should be weighted higher. Say the importance is decaying as you move away from a certain point $$c.$$ Then you might use $$\frac{\int_{a}^b w(x) f(x) g(x) \,dx}{\int_{a}^b w(x) \,dx}$$ with $$w(x)$$ (say) being defined as $$w(x)=e^{-k|x-c|},\quad k>0.$$

• Thanks for the answer. I get it in context with the Fourier transforms but doesn't it alter the very definition of similarity of the signals at any point since it should only be the product of f & g and not the w term.? Or is it just that we are scaling the product in the beginning by a large amount and the product scales exponentially less as we move away because of w(x)? Jul 26, 2022 at 16:01
• we simply care more about the similarity in a given region, see my edit, perhaps normalizing the weight function helps the understanding, since you could then compare different weight functions on an equal basis Jul 26, 2022 at 16:32
• let's say that the functions f(x) and g(x) are orthogonal with respect to weight function w(x) i.e. integral $$I=0$$ then f(x) and g(x) are not actually orthogonal (or linearly independent if I speak in analogy with orthogonal eigenvector) right? Then how and why can we express any function as the linear combination of f & g which are orthogonal with respect to w(x) only? Why does f and g still form a basis? Jul 28, 2022 at 6:58
• I've also edited the question. Jul 28, 2022 at 7:49

Okay, I think I see. I can roughly explain how this fits in with the idea of inner product of functions. The idea is that, suppose we have a vector space and choose a basis $$\{e_i\}$$ then the dot product of two functions depend on the inner product matrix:

$$v \cdot w= (v^1 e_1 +v^2 e_2 ) \cdot (w^1 e_1 + w^2 e_) = w^1 v^1 e_1 \cdot e_1 + w^2 v^2 e_2 \cdot e_2 + w^1 \cdot v^2 e_1 \cdot e_2 + w^2 \cdot v^1 e_2 \cdot e_1$$

Typically in Euclidean space, we choose $$e_1 \cdot e_1 = e_2 \cdot e_1 = 1$$ and $$e_2 \cdot e_1 = e_1 \cdot e_2 = 0$$

In matrix notation,

$$v \cdot w = v^t M w$$

Where $$M$$ is inner product matrix, but how is this consistent with the abstract axiomatic definition of inner product space? A function of two vectors is an inner product only if such a matrix (with some additional properties) actually exist. See here.

Now, here is a set of symbolic manipulation which may help you see what is going on, we can write. I use the Riemann deftn $$\int_0^b f(ih)= \sum_{i=0}^{\infty} f(ih) h$$, we have:

$$\left(\sum_{i=0}^{\infty} f(ih) h \right) \cdot_{\text{dot} } \left( \sum_{i=0}^{\infty} g(ih) h \right)= \sum_{i=0}^{\infty} f(ih) g(ih) w(ih) h$$

The idea is you split the interval $$[0,a]$$ into a set of equally paritioned point, to each point, we attach a number (similar to how we attach a number to a basis), so the values of functions of the function at points could in some sense be thought as components of vector with a basis. So, the dot product would be pointwise multiplication of these components weighted by the analogue of the inner product matrix here the $$h$$ comes to normalize for the width of partitions we take.

then f(x) and g(x) are not actually orthogonal

I think you may have skipped too many pages in your linear algebra textbook. Inner product determines orthogonality, not the other way around.

• >Inner product determines orthogonality, not the other way around. Yes I understand that very well. What I'm trying to say is that let's say there are two functions $$f(x)=x$$ $$g(x)=sin(2x)$$ then in the interval [-pi,pi ] their inner product is not zero i.e. they aren't orthogonal. But their inner product with respect to weight$$w(x)=x$$ is indeed zero and so they are orthogonal with respect to x right? Then how does f & g form an orthogonal basis of the function space? Jul 28, 2022 at 8:43
• When you choose a weight, that's a different inner product than without. @ApoorvMishra . It would be like choosing a different inner product matrix.
– Babu
Jul 28, 2022 at 9:01
• The same vector space has different orthogonal basis depending on inner product. See {here](en.wikipedia.org/wiki/…) , "an orthogonal basis for an inner product space {\displaystyle V}V is a basis for {\displaystyle V}V whose vectors are mutually orthogonal."
– Babu
Jul 28, 2022 at 9:02
• I came across such a problem while studying the Sturm Liouville equation $$Lu=\lambda.w(x)u(x)$$ whose solution is the eigenfunctions of the self-adjoint operator which are orthogonal with respect to the weighted inner product where w(x) is the weight function. Let's say the solution is $$u=y_m$$ & $$y_n$$ corresponding to eigenvalues$$\lambda_m$$ & $$\lambda_n$$. Then how are ym and yn the orthogonal basis when their inner product may not be zero? You can read about this on Wikipedia en.wikipedia.org/wiki/Sturm%E2%80%93Liouville_theory Jul 28, 2022 at 9:05
• They are orthogonal under w weighted inner product this is mentioned in wiki itself @apoorvMishra. Orthogonality can happen in diff ways acc. Inner produ
– Babu
Jul 28, 2022 at 9:28