# Interpreting the meaning of the distance between two functions

Given is the function $$f_j = [-2, 1] \rightarrow \mathbb{R} : x \rightarrow x^j, j \in \mathbb{N_0}$$

I'm suppossed to calculate the distance between $f_2$ and $f_1$, or rather $x^2$ and $x$.

Now, given is the distance formula $$<f|g> = \int_a^b{f(x)g(x)dx} | f, g \in C^0([-2,1])$$ and that the distance between two functions can be written as $$d(f, g) = (<f-g|f-g>)^\frac{1}{2}$$ which implies that $$d(f, g) = \sqrt{\int_a^b{(f-g) ^2dx}}$$

If we input our given functions, we find that $$d(f_2, f_1) = \sqrt{\int_{-2} ^1{(x^2-x)^2dx}} = 4.14$$

Now, I'm asking myself how to interpret this result. The two functions cross each other in the origin (which lies within the domain), so how can the distance be $4.14$? Is it the average distance? Or something completly different?

Just trying to make sense of what exactly I'm calculating here and how.

Thank you!

• As in your comment after the answer below, a reason you can't see why there's "only" this notion of distance-between-functions is that there are infinitely-many different possible reasonable notions of distance-between-functions, none of which has obvious priority over others. Thus, the operational question is only to check that your given particular distance-notion does indeed behave like a distance function (triangle inequality and so on). That is, it is futile to look for or expect evidence of specialness or uniqueness of "distance" in these infinite-dimensional spaces of functions... Nov 17 '16 at 22:19
• ... though, still, if you specify in advance a class of functions, and if you require a metric (or, more generally, a topology) so that that space is complete, if this is possible at all there is usually a very restricted class of possibilities. But that is a somewhat different question. Nov 17 '16 at 22:20
• Thanks, this kind of clears up some confusion. I supposse that this will have some practical application somewhere as I'm an engineering student, so maybe I'll gain some deeper inside into the topic once we actually require operations like this. Nov 17 '16 at 22:25
• Yes, indeed, one might find some preference for "distance/metric" notions that behave well with regard to Fourier series or Fourier transforms, for example... which is/are relevant to solving differential equations, especially the "classics" (heat, wave, Laplace's, Helmholtz', ...) Wanting/demanding utility in such directions starts to constrain the possibilities... Good stuff, for sure! Nov 17 '16 at 22:27

Two different functions can still have some values in common at some points. The "distance" isn't the minimal distance between points on the graphs, but rather takes into account the distance between function values at all points.

Think of this as you would think of vectors with a finite number of coordinates. Two vectors can have the same first coordinate, but be different vectors; their distance is zero if and only if their coordinates are the same for all coordinates. You can think of functions as generalized vectors that have infinitely many coordinates. Just as the vector $v\in \mathbb R^2$ has coordinates $v_1$ and $v_2$ (which you can think of as $v(1)$ and $v(2)$), the function $f$ has "coordinates" $f_x$ for each $x$ in the domain (we usually write $f(x)$ instead of $f_x$).

I hope this helps.

• I've pretty much come to the same conclusion as you did while thinking about that problem, and this is ironically where the question arised in the first place. We know how the formula is derived by it's relation to vectors, but what does the value actually represent? For vectors the root of their square is their distance to the origin, but you can't translate this to functions as they got infinitely many points, so it must surely be something else? Nov 17 '16 at 21:59
• @Skydiver: It is proportional to the root mean square difference between the two functions.
– user856
Nov 17 '16 at 23:28

If you want to deal with Riemann integrable functions, then you can approximate the inner product between functions by a Riemann sum. For example, divide the interval $[a,b]$ into $N$ equal intervals of length $\Delta_N=\frac{b-a}{N}$ and sample the functions at the center of each of the $N$ intervals, at say $x_1,x_2,x_3,\cdots,x_N$. Then $$\langle f,g\rangle_N = \sum_{n=1}^{N}f(x_n)g(x_n)\Delta_N$$ gives a pseudo inner product (meaning positive, but not necessarily positive definite.) And, $$\lim_{N}\langle f,g\rangle_N = \int_{a}^{b}f(x)g(x)dx.$$ So the inner product is approximated by a discrete inner product where the components of the vectors are point samples of the functions at the intermediate points $x_n$. That puts everything back into the context of inner products of discrete vectors. The components of the vectors are the point-sampled values of the functions. In this way you may think of a function as being approximated by a finite-dimensional vector, and a limit is possible because the total of the weights applied to all components sums to a finite, fixed number--namely to the length of the interval.

Historically, inner products were predated by integral orthogonality conditions between the functions used for Fourier series. The formalism of function "orthogonality" was originally a way to isolate coefficients in expansions of functions into trigonometric functions, and the discovery of orthogonality conditions was an amazing empirical observation that goes back to Euler and Clairaut in the mid 1700's. An abstract connection between such integral expressions and Euclidean norms took over a century to be seen, and then it another 50 years after that before a general inner product was defined in the early 1900's.

The fact that it took so long to see a connection between Euclidean dot products and integral orthogonal conditions should tell you that the connection is strained, and certainly wasn't obvious. So don't be alarmed if the connection seems strained to you, too. Part of the reason for the lack of obvious connection may have been due to the fact that the Riemann integral wasn't defined until 1859. At least we now have the benefit of that hindsight. All integrals were indefinite integrals before that. Riemann created his integral to study Fourier series. Lebesgue continued in this same way when he wrote that he also created his integral to study the convergence of the Fourier series. The evolution to a general notion of dot product or inner product was not straightforward, which is clear from the fact that such an evolution took 150 years. In some sense one is better off finding a connection only through the abstraction of an inner product. That abstraction of inner product was the real breakthrough linking all these ideas.