# find the distance between 2 functions

f(x) = $e^x$.

g(x) = $.5(e-1/e) + 3x/e$.

How do you find||f-g||.

The inner product is defined as $\int_{-1}^1 f(x)g(x) dx$.

I've tried this: $\int_{-1}^1 (e^x - (.5(e- e^{-1} + 3x/e)))^2dx$. This does not give the right answer of 1 -7e^-2.

• The definition is $d(f,g)= <f-g,f-g>^{1/2}$ , where $<,>$ is the inner-product. Can you do the rest? Feb 14 '14 at 2:01
• no. I've tried that, but I get the wrong answer. Feb 14 '14 at 2:03
• Do you want $\|f-g\|$ or $\|f-g\|^2$? Sometimes the question is for the square of the norm to avoid the square roots (see below). Feb 14 '14 at 2:09

Well, the norm (at least the norm induced by an inner product) is related to the inner product via $$\|f\|=\langle f,f\rangle^{1/2}.$$
In your case, you want $\|f-g\|$ and you have been told $\langle f,g\rangle:=\int_{-1}^1 f(x)g(x)\,dx$, so proceed accordingly: $$\|f-g\|=\langle f-g,f-g\rangle^{1/2}=\sqrt{\int_{-1}^1 [f(x)-g(x)]^2 dx}=\sqrt{1-7e^{-2}}\approx 0.229462.$$