Maximum of the sum of two functions with different variables

functionsmaxima-minimaoptimization

Let $x\in \mathbb{R}^n$ and $y\in \mathbb{R}^m$, and let $f:\mathbb{R}^{n+m}\to \mathbb{R}$ such that
$$
f(x,y) = g(x)+h(y)
$$

with $g$ and $h$ real functions (i.e. they map to the reals). Is it then true that $\max(f) = \max(g) + \max(h)$ as long as the maxima exist for all functions and $(\max(g), \max(h))\in Dom(f)$?

EDIT:

I am gonna write again the question but in a different way because I can see why it is confusing (I read it again and I didn't understand it completely myself) and also why I wanted to know this.

Let $f,g,h$ be as above, and let $z^*, x^*, y^*$ be such that $\max(f) = f(z^*)$, $\max(g) = g(x^*)$ and $\max(h) = h(y^*)$. Given the answers, it follows that
$$
f(z^*) = g(x^*) + h(y^*)
$$

but is it also true that $z^* = (x^*, y^*)$?

This question comes from a much simpler answer in which I want to maximize a function of the form $f(p, \pmb{\theta}) = f_1(p) + f_2(\pmb{\theta})$ where $f$ is a density function, $p$ is a scalar and $\pmb{\theta}$ a vector. I maximized $f_1$ and $f_2$ separately and found $p^*$ and $\pmb{\theta}^*$ maximum of their own functions, but is $(p^*,\pmb{\theta}^*)$ also the maximum of $f$? I believe it is true given the definition of maximum, but I wanted to know if there is a general result or theorem regarding this situation.

Best Answer

If you assume all maxima for $f,g,h$ exist, the result is straightforward.

Denote the maximum value the functions attain as $F, G, H$. Clearly $g(x) \leq G$ and $h(y) \leq H$ for any $x, y$. Thus $g(x) + h(y) \leq G + H$ for all $x,y$ too. Therefore $G+H$ is an upper bound of $f$, since $f(x,y) = g(x) + h(y)$. But since we assumed all functions attain maxima, we know that $g$ and $h$ attain their maxima at values say $x_g, y_g$ respectively. $f$ is well defined for these two values, and we see $$f(x_g,y_g) = g(x_g) + h(y_g) = G + H$$

But then $G+H$ is an upper bound that is attained over $f$, so $G+H$ is the maximum of $f$.

Related Question