Determining maximum of two functions Given:
$f:\mathbb{R}\rightarrow\mathbb{R}, x \mapsto x^3+x^2-6x$ and
$g:\mathbb{R}\rightarrow\mathbb{R},x\mapsto 3x+9$
I need to to determine $\max\{f,g\}$.  
I search on the internet and found:
$\max\{f(x),g(x)\}:=\frac{f(x)+g(x)+|f(x)-g(x)|}{2}$  
If I use my functions I get:
$\frac{x^3+x^2-3x+9+|x^3+x^2-9x-9|}{2}$, but how can I get rid of the absolute value?
Thabks in advance.
 A: Let us see first when is it that we have $f(x)=g(x)$:\begin{align}f(x)=g(x)&\iff x^3+x^2-6x=3x+9\\&\iff x^3+x^2-9x-9=0\\&\iff x^2(x+1)-9(x+1)=0\\&\iff(x^2-9)(x+1)=0\\&\iff x=-3\vee x=-1\vee x=3.\end{align}It turns out that $f(x)\geqslant g(x)$ if and only if $x\in[-3,-1]\cup[3,+\infty)$. Therefore$$\max\bigl\{f(x),g(x)\bigr\}=\begin{cases}f(x)&\text{ if }x\in[-3,-1]\cup[3,+\infty)\\ g(x)&\text{ otherwise.}\end{cases}$$
A: The two functions $f(x)$ and $g(x)$ have a graph like this

The $\max$ function is 
$$h(x)=\frac{1}{2} \left(\left| x^3+x^2-9 x-9\right| +x^3+x^2-3 x+9\right)$$
and its graph is the green one
Hope this helps
$$...$$

A: you have $\max\{f(x),g(x)\}=\frac{f(x)+g(x)+|f(x)-g(x)|}{2}$. the only thing that left to do is to separate the cases of $|\cdot|$, $|f(x)-g(x)|=\begin{cases}f(x)-g(x) & \text{if} & f(x)-g(x)\ge0\\[2ex]g(x)-f(x) & \text{if} & f(x)-g(x)\lt0\end{cases}$
you can't get rid of the absolute value without using cases. moreover you can see that the absolute value is the solution for the question. when you have question like this you should first try to create the equation of $\max\{f(x),g(x)\}$, because we define it to be $$\max\{f(x),g(x)\}:=\begin{cases}f(x) & \text{if} & f(x)\ge g(x)\\[2ex]g(x) & \text{if} & f(x)\lt g(x)\end{cases}$$here you can see that answering the absolute value contains in itself the answer for the $\max$ and you don't need equation $\max\{f(x),g(x)\}=\frac{f(x)+g(x)+|f(x)-g(x)|}{2}$
A: i would do case work:
At first: $$3x+9\geq x^3+x^2-6x$$ this is fulfilled for $$x\le -3$$ or $$-1\le x\le 3$$
in the other case $$3x+9<x^3+x^2-6x$$ and this given by
$$-3<x<-1$$ or $$x>3$$
