1. ## Compare two functions

I have two functions that I want to compare - call them f(x) and g(x), x is real, and f and g are R -> R. What is the most appropriate way to compare these functions? I should note that both of these functions are Riemann integrable - they are bounded and continuous.

One comparison could be h(x) = f(x)-g(x). Taking this a step further, we could integrate h to produce a numerical value for the difference between these two functions.

Another comparison is h(x) = f(x)/g(x). This function won't be continuous or bounded at the roots of g. We could also do log(h(x)).

Are there other ways to compare functions?

2. ## Re: Compare two functions

Hey heaviside.

What specific thing do you want to compare? If you say "closeness", then you need to say what "closeness" is.

A typical way to compare things is to use norms and a typical norm that is useful is the 2-norm where ||f,g|| = (f(x)-g(x))^2 where the norm is Integral over some region ||f,g||dx.

3. ## Re: Compare two functions

Thanks chiro

Yes - when I wrote this, I was thinking closeness. Or similarly, identifying how different two functions are when these functions are very similar but only slightly different. I know this is a lot of handwaving since I have not specified what 'similarity' is nor 'slightly different'.

I like the 2-norm approach. I've seen it many times but didn't think about using it in this instance. However, I can see that it is a better measure than simply f-g.