# Find or prove the existence of the maximum or minimum of a four-variable function.

I am an engineer and I am developing a research, I need to prove that this function has a maximum (or minimum) global. I do not remember how you do it, if you can help me, I thank you.

The function is $f:\mathbb{R^4}\longrightarrow \mathbb{R}$ $$f(x,y,z,w) = xy+\frac12(z-y)(x-w)$$

• $f(1,y,0,2)=y+\frac{1}{2}y$. For $y$ arbitrarily large $f(1,y,0,2)$ is arbitrarily large and for arbitrarily small (very negative) $f(1,y,0,2)$ is so too. But maybe your problem has other conditions on the variables. – Nina Simone Jul 26 '17 at 2:03
• What's the domain? If your parameters are bounded, then the function certainly does have a maximum and a minimum. – Alex Ortiz Jul 26 '17 at 2:03
• $$f(x,y,z,w)=xy+{1\over2}(z\cdot x-z\cdot w-x\cdot y-y\cdot w)={1\over2}(x\cdot y+z\cdot x-z\cdot w-y\cdot w)={1\over2}(x\cdot(y+z)+w\cdot(z-y))$$ Which is just $${1\over 2} (min(x,w)\cdot z +(max(x,y)-min(x,w))\cdot \text { relevant value for max(x,w)})$$ admittedly I'm not smart, especially in this area. – user451844 Jul 26 '17 at 2:09
• Sorry for not clarifying the domain, I fixed the issue in the last edit. Currently I still have no conditions on the values of $x, y, z, w$, so I would like to consider them real. – marcelolpjunior Jul 26 '17 at 2:38

If you fix $x$, $y$ and $z$, note that the function is linear with respect to $w$ (and non-constant). So it is not bounded.
I'm assuming that the domain of $f$ is $\Bbb R^4$.
Your function is a quadratic form, i.e., a homogeneous polynomial of degree $2$ in its variables. As such it is an animal occurring in linear algebra. You can write $f$ as $$f(x,y,z,w)={1\over2}(xy+xz+xw-zw)={1\over4}\>{\bf x}'A\,{\bf x}\ ,$$ whereby ${\bf x}$ is $(x,y,z,w)$ written as a column vector, and $A$ is the matrix $$A=\left[\matrix{0&1&1&1\cr 1&0&0&0\cr 1&0&0&-1\cr 1&0&-1&0\cr}\right]\ .$$ In order to analyze the behavior of $f$ we have to determine the eigenvalues of the matrix $A$. They are $$\lambda_1\doteq1.481,\quad \lambda_2=1,\quad\lambda_3\doteq-0.311,\quad\lambda_4\doteq-2.170\ .$$ Linear algebra then tell us that we can introduce in ${\mathbb R}^4$ orthonormal coordinates $\bar x_i$ $(1\leq i\leq 4)$ such that in these new coordinates the function $f$ appears as $$\bar f(\bar x_1,\bar x_2,\bar x_3,\bar x_4)={1\over4}\bigl(\lambda_1\bar x_1^2+\lambda_2\bar x_2^2+\lambda_3\bar x_3^2+\lambda_4\bar x_4^2\bigr)\ .$$ Since the $\lambda_i$ are $\ne0$ and have different signs the function $f$ has a (nondegenerate) saddle point at ${\bf 0}$.