The method of Lagrange multipliers can be applied to problems with more than one constraint. In this case the optimization function, [latex]w[/latex] is a function of three variables:
[latex]\large{w=f(x, y, z)}[/latex]
and it is subject to two constraints:
[latex]g(x, y, z)=0[/latex] and [latex]h(x, y, z)=0[/latex]
There are two Lagrange multipliers, [latex]\lambda_1[/latex] and [latex]\lambda_2[/latex], and the system of equations becomes:
Find the maximum and minimum values of the function
[latex]\large{f(x, y, z)=x^{2}+y^{2}+z^{2}}[/latex]
subject to the constraints [latex]z^{2}=x^{2}+y^{2}[/latex] and [latex]x+y-z+1=0[/latex].
Let’s follow the problem-solving strategy:
The optimization function is [latex]f(x, y, z)=x^{2}+y^{2}+z^{2}[/latex]. To determine the constraint functions, we first subtract [latex]z^2[/latex] from both sides of the first constraint, which gives [latex]x^2+y^2-z^2=0[/latex], so [latex]g(x,y,z)=x^2+y^2-z^2[/latex]. The second constraint function is [latex]h(x,y,z)=x+y-z+1[/latex].
We then calculate the gradients of [latex]f[/latex], [latex]g[/latex], and [latex]h[/latex]:
Next, we set the coefficients of [latex]\bf{i}[/latex], [latex]\bf{j}[/latex], and [latex]\bf{k}[/latex] equal to each other:
[latex]\hspace{9cm}\large{\begin{align} 2x_0&=2\lambda_1x_0+\lambda_2 \\ 2y_0&=2\lambda_1y_0+\lambda_2 \\ 2z_0&=2\lambda_1z_0-\lambda_2. \end{align}}[/latex]
The two equations that arise from the constraints are [latex]x_0^2=x_0^2+y_0^2[/latex] and [latex]x_0+y_0-z_0+1=0[/latex]. Combining these equations with the previous three equations gives
[latex]\hspace{7cm}\large{\begin{align} 2x_0&=2\lambda_1x_0+\lambda_2 \\ 2x_0&=2\lambda_1y_0+\lambda_2 \\ 2x_0&=2\lambda_1z_0-\lambda_2 \\ {z_0}^2&={x_0}^2+{y_0}^2 \\ x_0+y_0-z_0+1&=0. \end{align}}[/latex]
The first three equations contain the variable [latex]\lambda_2[/latex]. Solving the third equation for [latex]\lambda_2[/latex] and replacing into the first and second equations reduces the number of equations to four:
[latex]\hspace{7cm}\large{\begin{align} 2x_0&=2\lambda_1x_0-2\lambda_1z_0-2z_0 \\2y_0&=2\lambda_1y_0-2\lambda_1z_0-2z_0 \\{z_0}^2&={x_0}^2+{y_0}^2 \\x_0+y_0-z_0+1&=0.\end{align}}[/latex] Next, we solve the first and second equation for [latex]\lambda_1[/latex]. The first equation gives [latex]\lambda_1=\frac{x_0+z_0}{x_0-z_0}[/latex], the second equation gives [latex]\lambda_1=\frac{y_0+z_0}{y_0-z_0}[/latex]. We set the right-hand side of each equation equal to each other and cross-multiply:
Therefore, either [latex]z_0=0[/latex] or [latex]y_0=x_0[/latex]. If [latex]z_0=0[/latex], then the first constraint becomes [latex]0=x_0^2+y_0^2[/latex] The only real solution to this equation is [latex]x_0=0[/latex] and [latex]y_0=0[/latex], which gives the ordered triple [latex](0,0,0)[/latex]. This point does not satisfy the second constraint, so it is not a solution.Next, we consider [latex]y_0=x_0[/latex], which reduces the number of equations to three:
[latex]\hspace{8cm}\large{\begin{align} y_0&=x_0 \\ {z_0}^2&={x_0}^2+{y_0}^2 \\ x_0+y_0-z_0+1&=0. \end{align}}[/latex]
We substitute the first equation into the second and third equations:
Then, we solve the second equation for [latex]z_0[/latex], which gives [latex]z_0=2x_0+1[/latex]. We then substitute this into the first equation,
[latex]\hspace{7cm}\large{\begin{align} {z_0}^2&={2x_0}^2 \\ (2x_0+1)^2&={2x_0}^2 \\ {4x_0}^2+4x_0+1&={2x_0}^2 \\ {2x_0}^2+4x_0+1&=0 \end{align}}[/latex]
and use the quadratic formula to solve for [latex]x_0[/latex]:
Therefore, there are two ordered triplet solutions:
[latex]\left(-1+\frac{\sqrt2}2,-1+\frac{\sqrt2}2,-1+\sqrt2\right)[/latex] and [latex]\left(-1-\frac{\sqrt2}2,-1-\frac{\sqrt2}2,-1-\sqrt2\right).[/latex]
We substitute [latex]\left(-1+\frac{\sqrt2}2,-1+\frac{\sqrt2}2,-1+\sqrt2\right)[/latex] into [latex]f(x,y,z)=x^2+y^2+z^2[/latex], which gives
[latex]\hspace{3cm}\begin{align} f\left(-1+\frac{\sqrt2}2,-1+\frac{\sqrt2}2,-1+\sqrt2\right)&=\left(-1+\frac{\sqrt2}2\right)^2+\left(-1+\frac{\sqrt2}2\right)^2+\left(-1+\sqrt2\right)^2 \\ &=(1-\sqrt2+\frac12)+(1-\sqrt2+\frac12)+(1-2\sqrt2+2) \\ &=6-4\sqrt2. \end{align}[/latex] [latex]6+4\sqrt2[/latex] is the maximum value and [latex]6-4\sqrt2[/latex] is the minimum value of [latex]f(x,y,z)[/latex] subject to the given constraints.