If $x+ y = k$ for $x,y,k \in \Bbb R$ and $f(x, y) = xy$, then why does maxima of $f$ occurs when $x = y$? Why is it that out of all two numbers that have the same sum, say $20$, the two numbers that are closet together have the biggest product? Like $10$ and $10$, their product is $100$, but $5$ and $15$, their product is only $75$?
Thanks
 A: Well, let $k$ be a real number. If we fix $n$ then observe $$(n-k)(n+k) = n^2-k^2.$$ So, the larger $|k|$ is, the smaller the product will be.
A: You are trying to maximize, for a parameter $h$, $$x(h-x)=xh-x^2=\frac{h^2}{4}-\frac{h^2}{4}+hx-x^2=\frac{h^2}{4}-\left(\frac h2-x\right)^2$$
And thus it is clear that $x$ must be the closest possible to $\frac h2$.
A: Assume that $a>b$. Let $S=a+b$ and $D=a-b$. Then
$$ab=\frac{S+D}2\frac{S-D}2=\frac{S^2-D^2}4$$
and now it's clear that $ab$ decreases if $D$ increases.
A: There are various ways to approach this question. For one, if you graph the function $x(20-x)$, you get a downward-opening parabola with $x$-intercepts at $0$ and $20$, and with a peak right in the middle, because of symmetry.
Another way to look at it is this: If two numbers add up to $20$, then we can write them as $(10-k)$ and $(10+k)$. The product of those two is $10^2-k^2$, so we would want $k$ as small as possible if we want that to be large.
For a very different perspective, think of it geometrically. If you have $40$ inches of material out of which to make a rectangle, then half of your perimeter will be $20$ and the product of the two numbers adding to $20$ will be your area. The most room you can make inside that rectangle will not be achieved by squishing it into an oblong, but on the contrary, you want as much symmetry as possible. The most ideal shape would be a circle, but constrained to rectangles, the best we can do is to make a square!
A: Well, because given a fixed circumference of a rectangle, its area is the larger the more squary the rectangle is.
