Q:

Applications of differentiation and Lagrange Multipliers

let $D = \{ (x,y) : x + y = 1 ,  x,y \geq 0 \} $. I want to show that $ xy \leq \frac{1}{4} $ if $(x,y) \in D$.
My Attempt:
Put $f(x,y) = xy \implies \nabla f = (y,x) $
Put $g(x,y) = x+y-1 \implies \nabla g = (1,1)$
Applying LAgrange multipliers we obtain:
$$ \nabla f = \lambda \nabla g \implies y = \lambda = x$$
Hence, $2 \lambda - 1 = 0 \implies \lambda = \frac{1}{2} $
So, a suspicious point is $( \frac{1}{2}, \frac{1}{2} )$.
My question: Do I need to check points in the boundary too? How Can I do this? This is the point of the Lagrange method that confuses me. It would be nice if someone can clarify this to me. thanks

A:

You do not need to check the boundary. Notice that $D$ is a line segment in the plane, hence closed, and containing its boundary (which is empty, since $D$ has no interior points). Your calculations are all ok.
If $D$ was, say, $\{(x,y) \in \Bbb R^2 \ : \ x + y \leq 1, x,y \geq 0\}$, you would have to use Lagrange to check the part $x+y = 1$, just like you did above, you would have to check the segments from $(0,0)$ to $(1,0)$, the segment from $(0,0)$ to $(0,1)$, and the interior of the set. You can parametrize the first segment, say, by $\gamma(t) = (0, t)$, where $0 \leq t \leq 1$ and look at $f(\gamma(t)) = 0 t = 0$, just like in single-variable calculus. This case is trivial (but it could not be, if the function were another). Same thing for the other segment. And for the interior, look at the points where $\nabla f(x,y) = {\bf 0}$.

In fact, you do not need Lagrange to solve this. The line segment can be parametrized as $\gamma(t) = (t, 1-t)$, with $0 \leq t \leq 1$. So, we have $f(\gamma(t)) = t(1-t) = t - t^2$, whence: $$\frac{\mathrm{d}}{\mathrm{d}t}f(\gamma(t)) = 0 \iff 1 - 2t = 0 \iff t = \frac{1}{2},$$ so the critical point is $\left(\frac{1}{2}, \frac{1}{2}\right)$. The value attained at this point is a maximum, because $$\frac{\mathrm{d}^2}{\mathrm{d}t^2}f\left(\gamma\left(\frac{1}{2}\right)\right) = -2 < 0.$$

