# What are the extrema and saddle points of f(x, y) = xy+e^(-x^2-y^2)?

Feb 11, 2018

We have:

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

Step 1 - Find the Partial Derivatives

We compute the partial derivative of a function of two or more variables by differentiating wrt one variable, whilst the other variables are treated as constant. Thus:

The First Derivatives are:

${f}_{x} = y + {e}^{- {x}^{2} - {y}^{2}} \left(- 2 x\right)$
$\setminus \setminus \setminus = y - 2 x {e}^{- {x}^{2} - {y}^{2}}$

${f}_{y} = x + {e}^{- {x}^{2} - {y}^{2}} \left(- 2 y\right)$
$\setminus \setminus \setminus = x - 2 y {e}^{- {x}^{2} - {y}^{2}}$

The Second Derivatives (quoted) are:

${f}_{x x} = - 2 {e}^{- {x}^{2} - {y}^{2}} + 4 {x}^{2} {e}^{- {x}^{2} - {y}^{2}}$

${f}_{y y} = - 2 {e}^{- {x}^{2} - {y}^{2}} + 4 {y}^{2} {e}^{- {x}^{2} - {y}^{2}}$

The Second Partial Cross-Derivatives are:

${f}_{x y} = 1 + 4 x y {e}^{- {x}^{2} - {y}^{2}}$

${f}_{y x} = 1 + 4 x y {e}^{- {x}^{2} - {y}^{2}}$

Note that the second partial cross derivatives are identical due to the continuity of $f \left(x , y\right)$.

Step 2 - Identify Critical Points

A critical point occurs at a simultaneous solution of

${f}_{x} = {f}_{y} = 0 \iff \frac{\partial f}{\partial x} = \frac{\partial f}{\partial y} = 0$

i.e, when:

 {: (f_x = y -2x e^(-x^2-y^2), = 0, ... [A]), (f_y = x -2y e^(-x^2-y^2), = 0, ... [B]) :}} simultaneously

From which we can establish:

$\left[A\right] \implies y - 2 x {e}^{- {x}^{2} - {y}^{2}} = 0 \implies {e}^{- {x}^{2} - {y}^{2}} = \frac{y}{2 x}$
$\left[B\right] \implies x - 2 y {e}^{- {x}^{2} - {y}^{2}} = 0 \implies {e}^{- {x}^{2} - {y}^{2}} = \frac{x}{2 y}$

Thus we require that:

$\frac{y}{2 x} = \frac{x}{2 y}$
$\therefore {x}^{2} = {y}^{2}$

Then we have two (infinite plane) solutions:

$\therefore x = \pm y$

And so we conclude there are infinitely many critical points along the entire lengths of the intersection of the curve and the two planes $x = \pm y$

Step 3 - Classify the critical points

In order to classify the critical points we perform a test similar to that of one variable calculus using the second partial derivatives and the Hessian Matrix.

$\Delta = H f \left(x , y\right) = | \left({f}_{x x} \setminus \setminus {f}_{x y}\right) , \left({f}_{y x} \setminus \setminus {f}_{y y}\right) | = | \left(\frac{{\partial}^{2} f}{\partial {x}^{2}} , \frac{{\partial}^{2} f}{\partial x \partial y}\right) , \left(\frac{{\partial}^{2} f}{\partial y \partial x} , \frac{{\partial}^{2} f}{\partial {y}^{2}}\right) |$
$\setminus \setminus \setminus = {f}_{x x} {f}_{y y} - {\left({f}_{x y}\right)}^{2}$

Then depending upon the value of $\Delta$:

$\left.\begin{matrix}\Delta > 0 & \text{There is maximum if " f_(x x)<0 \\ \null & "and a minimum if " f_(x x)>0 \\ Delta<0 & "there is a saddle point" \\ Delta=0 & "Further analysis is necessary}\end{matrix}\right.$

$\Delta = \left\{- 2 {e}^{- {x}^{2} - {y}^{2}} + 4 {x}^{2} {e}^{- {x}^{2} - {y}^{2}}\right\} \left\{- 2 {e}^{- {x}^{2} - {y}^{2}} + 4 {y}^{2} {e}^{- {x}^{2} - {y}^{2}}\right\} - {\left\{1 + 4 x y {e}^{- {x}^{2} - {y}^{2}}\right\}}^{2}$

$\setminus \setminus \setminus = {e}^{- 2 \left({x}^{2} + {y}^{2}\right)} \left(- 8 x y {e}^{{x}^{2} + {y}^{2}} - {e}^{2 \left({x}^{2} + {y}^{2}\right)} - 8 {x}^{2} - 8 {y}^{2} + 4\right)$

We need to consider the sign of $\Delta$, and we note that ${e}^{z} > 0 \forall z \in \mathbb{R}$, so only need to consider the sign of:

$\Delta ' = - 8 x y {e}^{{x}^{2} + {y}^{2}} - {e}^{2 \left({x}^{2} + {y}^{2}\right)} - 8 {x}^{2} - 8 {y}^{2} + 4$

So, depending upon the sign $\Delta '$ we have an infinite number maxima and saddle points along the planes $x = \pm y$

Here is a plot of the function

And here is a plot of the function including the planes $x = \pm y$