Find the function of separation between two functions

I seriously doubt that is what it is actually called, but I'm not very knowledgeable in this matter.

Conceptually, what I am trying to do is calculate the function of a line/curve that shows the divide between two other functions. As a visual example:

$$Red: f(x) = x^2 + 2$$ $$Blue: g(x) = -(x-3)^2$$

The orange curve would be some function $h(x)$, where all points on one side of the function would be nearest $f(x)$ and all points on the other side would be nearest $g(x)$. I would like to find a way to figure out what $h(x)$ is.

I'm sure something like this already exists, but I don't even know what to google to find out. I'd also like to mention that I'm looking for a general solution, not something specific to quadratic functions.

• If anyone wants to mess around with a graph, here: desmos.com/calculator/bvrekoymb5 – Conor O'Brien May 8 '15 at 2:27
• @CᴏɴᴏʀO'Bʀɪᴇɴ That is the exact site I used to draw up the image for the example (sans h(x), which I drew in manually). To clarify, though, I'm not looking for a solution to this specific pair of functions. – Abion47 May 8 '15 at 3:05
• Obviously many different separating functions $h$ are possible. A pretty simple one would be $h(x) = \frac{f(x) + g(x)}{2}$. This $h$ at least has a name, it is the average of $f$ and $g$. – Mike F May 8 '15 at 6:09
• @MikeF At first glance this strikes me as an ideal solution, but upon further pondering I wonder if there would be a case where a point would be under $h$ in the y direction and thus "closer" to $f$, but technically closer to $g$ in some direction other than vertical? Would such a concern even matter? – Abion47 May 8 '15 at 9:06
• @Abion47: I guess you need to decide more precisely what you mean by a separating function. As you say, the average is precisely halfway between them in the vertical direction, but perhaps not by other measures of "halfway between". – Mike F May 8 '15 at 17:28