How do you find the maximum value of the function f(x,y,z)= x+2y-3z subject to the constraint z=4x^2+y^2?

May 2, 2017

$\frac{17}{48}$

Explanation:

Forming the lagrangian

$L \left(x , y , z , \lambda\right) = f \left(x , y , z\right) + \lambda g \left(x , y , z\right)$

with

$g \left(x , y , z\right) = 4 {x}^{2} + {y}^{2} - z = 0$

The stationary points are computed solving

$\nabla L \left(x , y , z , \lambda\right) = 0$

or

$\left\{\begin{matrix}1 + 8 \lambda z = 0 \\ 2 + 2 \lambda y = 0 \\ 3 + \lambda = 0 \\ 4 {x}^{2} + {y}^{2} - z = 0\end{matrix}\right.$

and solving for $\left(x , y , z , \lambda\right)$ we obtain

$\left\{\begin{matrix}x = \frac{1}{24} \\ y = \frac{1}{3} \\ z = \frac{17}{144} \\ \lambda = - 3\end{matrix}\right.$

and the maximum value is

$\frac{17}{48}$

NOTE: To qualify the stationary point it is necessary to form

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

and then calculate

$H = {\nabla}^{2} \left(f \circ g\right) = \left(\begin{matrix}- 24 & 0 \\ 0 & - 6\end{matrix}\right)$

As we can observe, $H$ has negative eigenvalues indicating that the found solution represents a maximum.

May 2, 2017

Explanation:

Given: $f \left(x , y , z\right) = x + 2 y - 3 z$ and the constraint function $g \left(x , y , z\right) = 4 {x}^{2} + {y}^{2} - z = 0$

The Lagrange function is:

$L \left(x , y , z , \lambda\right) = f \left(x , y , z\right) + \lambda g \left(x , y , z\right)$

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

We compute the partial derivatives:

$\frac{\partial L \left(x , y , z , \lambda\right)}{\partial x} = 1 + 8 \lambda x$

$\frac{\partial L \left(x , y , z , \lambda\right)}{\partial y} = 2 + 2 \lambda y$

$\frac{\partial L \left(x , y , z , \lambda\right)}{\partial z} = - 3 - \lambda$

$\frac{\partial L \left(x , y , z , \lambda\right)}{\partial \lambda} = 4 {x}^{2} + {y}^{2} - z$

Set these 4 derivatives equal to zero and then solve them as a system of equation:

$0 = 1 + 8 \lambda x \text{ }$

$0 = 2 + 2 \lambda y \text{ }$

$0 = - 3 - \lambda \text{ }$

$0 = 4 {x}^{2} + {y}^{2} - z \text{ }$

Solve equation  for $\lambda$:

$\lambda = - 3$

Substitute -3 for $\lambda$ into equation :

$0 = 1 + 8 \left(- 3\right) x \text{ }$

$x = \frac{1}{24}$

Substitute -3 for $\lambda$ into equation :

$0 = 2 + 2 \left(- 3\right) y$

$y = \frac{1}{3}$

Use equation  to find the value of z:

$z = 4 {\left(\frac{1}{24}\right)}^{2} + {\left(\frac{1}{3}\right)}^{2}$

$z = \frac{17}{144}$

$f \left(\frac{1}{24} , \frac{1}{3} , \frac{17}{144}\right) = \frac{1}{24} + \frac{2}{3} - \frac{51}{144}$

$f \left(\frac{1}{24} , \frac{1}{3} , \frac{17}{144}\right) = \frac{17}{48}$

Note: One cannot use the second derivative to test whether the Lagrange multiplier has given you a maximum or a minimum; the only way to determine whether the value is a local maximum is perturbation of values. I will leave that exercise to you.