buscandoaireka8u

2023-02-18

How to find the maximum value of the function $f\left(x,y,z\right)=x+2y-3z$ subject to the constraint $z=4{x}^{2}+{y}^{2}$?

Jakob Howell

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$
calculating and solving for the stationary points
$g\left(x,y,z\right)=4{x}^{2}+{y}^{2}-z=0$
or
$\left\{\begin{array}{l}1+8\lambda z=0\\ 2+2\lambda y=0\\ 3+\lambda =0\\ 4{x}^{2}+{y}^{2}-z=0\end{array}$
and solving for $\left(x,y,z,\lambda \right)$ we obtain
$\left\{\begin{array}{l}x=\frac{1}{24}\\ y=\frac{1}{3}\\ z=\frac{17}{144}\\ \lambda =-3\end{array}$
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+2y-3\left(4{x}^{2}+{y}^{2}\right)$
and then calculate
$H={\nabla }^{2}\left(f\circ g\right)=\left(\begin{array}{cc}-24& 0\\ 0& -6\end{array}\right)$
As we can observe, $H$ has negative eigenvalues indicating that the found solution represents a maximum.

Given: $f\left(x,y,z\right)=x+2y-3z$ 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+2y-3z+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$
These 4 derivatives should be set to zero before they are solved as a system of equations:
$0=1+8\lambda x\phantom{\rule{1ex}{0ex}}\text{[1]}$
$0=2+2\lambda y\phantom{\rule{1ex}{0ex}}\text{[2]}$
$0=-3-\lambda \phantom{\rule{1ex}{0ex}}\text{[3]}$
$0=4{x}^{2}+{y}^{2}-z\phantom{\rule{1ex}{0ex}}\text{[4]}$
Solve equation [3] for $\lambda$:
$\lambda =-3$
Substitute -3 for $\lambda$ into equation [1]:
$0=1+8\left(-3\right)x\phantom{\rule{1ex}{0ex}}\text{[1]}$
$x=\frac{1}{24}$
Substitute -3 for $\lambda$ into equation [2]:
$0=2+2\left(-3\right)y$
$y=\frac{1}{3}$
Use equation [4] 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.

Do you have a similar question?