# An example of the maximum of $f(x)$ and the maximum of $g(x)$ does not to equal to the maximum of $(f+g)(x)$

Let's $f(x)$ and $g(x)$ be continuous functions on $[0,1]$.

Show an example of the maximum of $f(x)$ and $g(x)$ does not equal to the maximum of $(f+g)(x)$ on $[0,1]$.

Now I have tried to find an example, but for each time, the maximum of $f(x) +$ the maximum of $g(x)$ would equal to the maximum of $(f+g)(x)$. For example, I would have $f(x) = x^2$ and $g(x) = x+2$. The maximum of $f(x)$ would be $1$ and the maximum of $g(x) = 3$, so $1+3 = 4$. However, when I have $(f+g)(x) = x^2 + x + 2$, the maximum of $(f+g)(x) = 4$. This would happen each time I used a continuous function for both $f(x)$ and $g(x)$. Any help would be greatly appreciated.

-
Hint: You need $f(x)$ and $g(x)$ to have their maxima in different places. – mjqxxxx Oct 13 '12 at 14:47
What does "the maximum of f(x) and g(x)" mean exactly for you? – DonAntonio Oct 13 '12 at 14:50
– Did Oct 13 '12 at 14:51
I may be wrong, but when I mentioned maximum here, I am referring to global maximum. I thought the global maximum can be found by the closed interval [0,1] and since 1 is the highest number in the interval, the maximum of f(x) would be 1 and the maximum of g(x) would be 3. Please correct me if I am wrong. – Bo Davis Oct 13 '12 at 14:57
Hint $U+ /\$... – N. S. Oct 13 '12 at 15:27

The problem is that your functions take their maximal values at the same point, so they add up to the maximal value of the sum. Try finding two functions that take their maximal values at different points on this interval.

-

As others have said, look for functions with maxima in different places. Try looking at trigonometric functions. Particularly, $\sin$ and $\cos$.

-

HINT: In such questions counterexamples often arise from the fact that while adding $f(x)+g(x)$ some terms may get cancelled. One example would be $f(x)=2x$ and $g(x)=5-2x$.

EDIT:

Note that $\max (f(x))=2$ and $\max(g(x))=5$ on the interval $[0,1]$. But $(f+g)(x) =3 \ \forall x \in [0,1]$.

Also I'ld like to point out a fact that $\max\{f(x)+g(x)\} \leq \max\{f(x)\} +\max\{g(x)\}$

-
@BoDavis The maximum of $5-2x$ on $[0,1]$ is not $3$. – Théophile Oct 13 '12 at 15:21
You're right, Theophile. That was a mistake on my part. – Bo Davis Oct 13 '12 at 18:09