Division by 0 in Lagrange multipliers problems: is there some foolproof method?

173 Views Asked by At

I'm studying the method of Langrange multipliers right now, so I've been reading various materials on it, and it seems like there aren't any established, foolproof ways to solve these types of problems.

What I mean here is that some solutions consider a lot more "candidate" points that I can think of, while some seem to just ignore a lot of (potentially) important points (e.g., in cases when you divide by 0).

For example, my textbook is trying to optimize $f(x,y)=5-x^2-(y-1)^2$ on the boundary $g(x,y)=(x-2)^2+y^2$ such that $g(x,y)=1$. As usual, my textbook finds the gradient vectors of $f$ and $g$ to get

$$-2x = \lambda(2x-4)$$$$-2y+2=\lambda(2y)$$

Using the first equation, my textbook then immediately divides $-2x$ by $2x-4$ to give $\lambda = \frac{-2x}{2x-4}$. This is then substituted into the second equation to finally give the candidate points $(2-\frac{2}{\sqrt{5}}, \frac{1}{5})$ and $(2+\frac{2}{\sqrt{5}}, -\frac{1}{5})$. Luckily, the maximum and minimum on the boundary are found with just these points.

I find this odd because we can only perform the above steps if $x\neq 2$. However, my textbook doesn't consider the case when $x = 2$ (and hence, $y=\pm 1$, since $g(x,y)=1$). Was this done deliberately, or am I missing something?