# What are the local extrema an saddle points of f(x,y) = x^2 + xy + y^2 + 3x -3y + 4?

Jun 17, 2018

#### Explanation:

The function is

$f \left(x , y\right) = {x}^{2} + x y + {y}^{2} + 3 x - 3 y + 4$

The partial derivatives are

$\frac{\partial f}{\partial x} = 2 x + y + 3$

$\frac{\partial f}{\partial y} = 2 y + x - 3$

Let $\frac{\partial f}{\partial x} = 0$ and $\frac{\partial f}{\partial y} = 0$

Then,

$\left\{\begin{matrix}2 x + y + 3 = 0 \\ 2 y + x - 3 = 0\end{matrix}\right.$

$\implies$, $\left\{\begin{matrix}x = - 3 \\ y = 3\end{matrix}\right.$

$\frac{{\partial}^{2} f}{\partial {x}^{2}} = 2$

$\frac{{\partial}^{2} f}{\partial {y}^{2}} = 2$

$\frac{{\partial}^{2} f}{\partial x \partial y} = 1$

$\frac{{\partial}^{2} f}{\partial y \partial x} = 1$

The Hessian matrix is

$H f \left(x , y\right) = \left(\begin{matrix}\frac{{\partial}^{2} f}{\partial {x}^{2}} & \frac{{\partial}^{2} f}{\partial x \partial y} \\ \frac{{\partial}^{2} f}{\partial y \partial x} & \frac{{\partial}^{2} f}{\partial {y}^{2}}\end{matrix}\right)$

The determinant is

$D \left(x , y\right) = \det \left(H \left(x , y\right)\right) = | \left(2 , 1\right) , \left(1 , 2\right) |$

$= 4 - 1 = 3 > 0$

Therefore,

$D \left(1 , 1\right) > 0$ and $\frac{{\partial}^{2} f}{\partial {x}^{2}} > 0$, there is a local minimum at $\left(- 3 , 3\right)$

Jun 17, 2018

Local minimum: $\left(- 3 , 3\right)$

#### Explanation:

The group of points that include both extrema and saddle points are found when both $\frac{\partial f}{\partial x} \left(x , y\right)$ and $\frac{\partial f}{\partial y} \left(x , y\right)$ are equal to zero.

Assuming $x$ and $y$ are independent variables:
$\frac{\partial f}{\partial x} \left(x , y\right) = 2 x + y + 3$
$\frac{\partial f}{\partial y} \left(x , y\right) = x + 2 y - 3$

So we have two simultaneous equations, which happily happen to be linear:
$2 x + y + 3 = 0$
$x + 2 y - 3 = 0$

From the first:
$y = - 2 x - 3$
Substitute into the second:
$x + 2 \left(- 2 x - 3\right) - 3 = 0$
$x - 4 x - 6 - 3 = 0$
$- 3 x - 9 = 0$
$x = - 3$
Substitute back into the first:
$2 \left(- 3\right) + y + 3 = 0$
$- 6 + y + 3 = 0$
$- 3 + y = 0$
$y = 3$

So there is one point where the first derivatives uniformly become zero, either an extremum or a saddle, at $\left(x , y\right) = \left(- 3 , 3\right)$.

To deduce which, we must compute the matrix of second derivatives, the Hessian matrix (https://en.wikipedia.org/wiki/Hessian_matrix):
$\left(\begin{matrix}\frac{{\partial}^{2} f}{\partial {x}^{2}} & \frac{{\partial}^{2} f}{\partial x \partial y} \\ \frac{{\partial}^{2} f}{\partial y \partial x} & \frac{{\partial}^{2} f}{\partial {y}^{2}}\end{matrix}\right)$

$\frac{{\partial}^{2} f}{\partial {x}^{2}} = 2$
$\frac{{\partial}^{2} f}{\partial x \partial y} = 1$
$\frac{{\partial}^{2} f}{\partial y \partial x} = 1$
$\frac{{\partial}^{2} f}{\partial {y}^{2}} = 2$

Thus
$\left(\begin{matrix}\frac{{\partial}^{2} f}{\partial {x}^{2}} & \frac{{\partial}^{2} f}{\partial x \partial y} \\ \frac{{\partial}^{2} f}{\partial y \partial x} & \frac{{\partial}^{2} f}{\partial {y}^{2}}\end{matrix}\right) = \left(\begin{matrix}2 & 1 \\ 1 & 2\end{matrix}\right)$
All second order derivatives are uniformly constant whatever the values of $x$ and $y$, so we do not need to specifically compute the values for the point of interest.

NB The order of differentiation does not matter for functions with continuous second derivatives (Clairault's Theorem, application here: https://en.wikipedia.org/wiki/Symmetry_of_second_derivatives), and so we expect that $\frac{{\partial}^{2} f}{\partial x \partial y} = \frac{{\partial}^{2} f}{\partial y \partial x}$, as we see in our specific result above.

In this two-variable case, we can deduce the type of point from the determinant of the Hessian, $\frac{{\partial}^{2} f}{\partial {x}^{2}} \frac{{\partial}^{2} f}{\partial {y}^{2}} - \frac{{\partial}^{2} f}{\partial x \partial y} \frac{{\partial}^{2} f}{\partial y \partial x} = 4 - 1 = 3$.

A form of the test to administer is given here:
https://en.wikipedia.org/wiki/Second_partial_derivative_test#The_test

We see that the determinant is $> 0$, and so is $\frac{{\partial}^{2} f}{\partial {x}^{2}}$. So we conclude that $\left(- 3 , 3\right)$, the sole point of zero first derivative, is a local minimum of the function.

As a sanity check for a one-dimensional function question, I usually post the graph of it, but Socratic does not have a surface or contour plotting facility suitable for two-dimensional functions, so far as I can see. So I will overplot the two functions $f \left(- 3 , y\right)$ and $f \left(x , 3\right)$, which do not characterise the whole function domain for us, but will show us the minimum between them, which appears as expected at $y = 3$ and $x = - 3$, taking identical function value $f = - 5$ in each case.

As $f \left(x , y\right) = {x}^{2} + x y + {y}^{2} + 3 x - 3 y + 4$
$f \left(- 3 , y\right) = {y}^{2} - 6 y + 4$
$f \left(x , 3\right) = {x}^{2} + 6 x + 4$
graph{(x-(y^2-6y+4))(y-(x^2+6x+4))=0 [-10, 5, -6, 7]}