Let's say I've got

$$f : \mathbb{R} \to \mathbb{R}\\ \qquad\qquad\quad x\mapsto x^3+x^2-6x$$


$$g : \mathbb{R} \to \mathbb{R}\\ \qquad\quad x\mapsto 3x+9$$

and I need to find $\max(f,g)$. I started setting them equal, and finding the roots, but this doesn't seem to be the right way. How does one find the max of two functions? I know, e.g.

$$\max(f,g)(x) = \max\{f(x),g(x)\}$$

  • $\begingroup$ This depe3nds on what "find" means. Why is the trivially correct answer $x\mapsto \max\{f(x),g(x)\}$ discouraged? $\endgroup$ – Hagen von Eitzen Jan 29 '18 at 20:49
  • $\begingroup$ @HagenvonEitzen I agree, my question could have been asked more precisely $\endgroup$ – user3125470 Jan 29 '18 at 23:22

You have the right idea.

The best way to go about finding $\textrm{max}(f,g)$ is to find their intersection points by setting $f=g$ and finding the roots, and then plot the two graphs to see where each is at a maximum. The curves $y = x^3 + x^2 - 6x$ and $y = 3x + 9$

In your case, the two functions intersect at $x = -3$, $x = -1$ and $x = 3$. Looking at the graph above we clearly see which of $f$ and $g$ are at a maximum for each of the intervals $x \leq -3$, $-3 \leq x \leq -1$, $-1 \leq x \leq 3$ and $x \geq 3$. As a result we get that

\begin{equation*} \textrm{max}(f,g) = \left\{\begin{array}{cc} 3x + 6 & x \leq -3 \\ x^3 + x^2 - 6x & -3 \leq x \leq -1 \\ 3x + 6 & -1 \leq x \leq 3 \\ x^3 + x^2 - 6x & x \geq 3 \end{array} \right. \end{equation*}

This function looks like this for $-5 \leq x \leq 5$:

enter image description here

| cite | improve this answer | |

ODF's answer is great and you should probably accept it. If you want a single formula, you can use simply that $$\max(f,g)(x) = \frac{f(x)+g(x) + |f(x)-g(x)|}{2},$$although further analysis will require you to attack that absolute value. You also have $$\min(f,g)(x) = \frac{f(x)+g(x)-|f(x)-g(x)|}{2}.$$

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.