find the distance between 2 functions

18.3k Views Asked by At

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.

1

There are 1 best solutions below

1
On BEST ANSWER

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. $$