# Lagrange Multiplier when one variable is equal to zero?

I want to solve a Lagrange multiplier problem,

$$f(x,y) = x^2+y^2+2x+1$$ $$g(x,y)=x^2+y^2-16$$

Where function $g$ is my constraint. $$f_x=2x+2, \ \ \ f_y=2y, \ \ \ g_x=2x\lambda, \ \ \ g_y=2y\lambda$$

$$\begin{cases} 2x+2=2x\lambda \\ 2y=2y\lambda \\ x^2+y^2-16=0 \end{cases}$$

See, this is a very nasty system of equations. At any rate, I get $\lambda = 1$ because in this case, $y=0$. So I cannot do anything with this as far as algebra is concerned? How do I resolve a problem like this?

• The last line $x^2+y^2-16$ is not an equation.
– edm
Sep 30, 2017 at 2:30
• @edm: It is, now. You could have been more welcoming and solve the issue yourself. Sep 30, 2017 at 2:43
• Why use Lagrange multipliers? If $g(x,y)=0$ then $f(x,y)=2x+17$, so one is just maximising/minimising $x$ on the circle with centre $(0,0)$ and radius $4$. Obviously the extreme points are $(x,y)=(\pm4,0)$. Sep 30, 2017 at 3:41
• Lagrange multiplier problems are notorious for highlighting sloppy algebra. The desired answers are often lost when you do common mistakes like divide by a variable that could be zero, which I imagine is how you arrived at $\lambda = 1$.
– user14972
Sep 30, 2017 at 7:25

$2x(1-\lambda) = -2\tag 1$

$2y(1-\lambda) = 0\tag 2$

From (2) Either $y = 0$ or $(1-\lambda) = 0$

$(1-\lambda) \ne 0$ because if it were (1) would not be true

Thus $y = 0$

Plug in the value of y in g(x,y) and find x.

and $x = +/- 4$

The points are $(4,0)$ and $(-4,0)$

• Can you work this entire solution out? How are you getting $\pm4$? Sep 30, 2017 at 5:08
• plug the value of y=0 in g(x,y) and you will get $x^2 = 16$ and hence the solution Sep 30, 2017 at 5:11 this method was taught in our class Hope this could help you

• What do you mean nothing can be predicted? That is not an option to not be able to predict the local maximum or minimum Sep 30, 2017 at 7:40
• Since Hessian matrix is zero. We can't predict whether $f(x,y)=x^2+y^2+2x+1$ will maximize or minimise under given constraint $x^2+y^2-16$
– ashi
Sep 30, 2017 at 7:59