Find the natural numbers $a$ and $b$ so that $a\cdot b$ has the largest possible value but $a + b = x$ must hold. Is there a way to find the natural numbers $a$ and $b$ so that $a\cdot b$ has the largest possible value but $a + b = x$ must hold. It's easy small numbers but is there any way, through calculus or otherwise, to solve the general case?
 A: Yes, you just take $a$ and $b$ such that they are the closest possible to $x/2$. 
The reason is that $a*b=a(x-a)$ which viewed as a function of a, is maximized at $a=x/2$ and strictly decreases as $a$ goes away from the value $x/2$.
A: Take $(a-b)^2$.  Any square is positive (except $0^2=0$) so you can conclude that
\begin{align}
0&\le(a-b)^2  &&\text{expand square binom:}\\
0&\le a^2-2ab+b^2   &&\text{add $4ab$ at both sides:}\\
4ab&\le a^2+2ab+b^2  &&\text{factorize square binom:}\\
4ab&\le(a+b)^2  &&\text{replace $x$:}\\
4ab&\le x^2  &&\text{divide by $4$:}\\
a\cdot b&\le\frac14x^2
\end{align}
So we have a max boundary for $a\cdot b$.  Now we must find that $a\cdot b=\frac14x^2$. If $x$ is odd it does not as $x^2$ is odd and $4$ does not divide $x^2$.
In the formula above, we can replace all $\le$ with $=$ if we make $a-b=0$, this is when $a=b=\frac12x$ which work for $x$ even.
For $x$ odd we cannot have $a=b$ so we will try the closest alternative: $a=b+1$ which means $a=\frac{x+1}2$ and $b=\frac{x-1}2$.  We hav (following the formulas)
\begin{align}
a-b &= 1\\
(a-b)^2 &= 1\\
a^2-2ab+b^2 &= 1\\
a^2+2ab+b^2 &= 4ab+1 \\
(a+b)^2 &= 4ab+1 \\
x^2 &= 4ab+1 \\
x^2-1 &= 4ab \\
ab &= \frac14(x^2-1)
\end{align}
Note that $\frac14(x^2-1)$ is the closest integer bellow $x^2$ for $x$ odd.
So the maximum value for $a\cdot b$ is:
$$
a\cdot b=\left\lfloor\frac14x^2\right\rfloor,
\qquad a=\left\lceil\frac12x\right\rceil,
\qquad b=\left\lfloor\frac12x\right\rfloor.
$$
(And no calculus was required)
A: We have$$a+b=x$$
$$b=x-a$$
Let us define a function $$y=a*b$$
$$ y=a*(x-a)$$
Differentiation y w.r.t. a, we get
$$y'=x-a-a$$
$$y'=x-2a$$
$y'=0$ implies a=$\frac {x}{2}$. Now $y''=-2a$ is always less than 0. Hence a=$\frac {x}{2}$ is a maxima.
A: A useful tool when looking for maxima/minima with a constraint is to use Lagrange's multipliers (found in any book of multivariable calculus):
Let $P(a,b)=ab$ and $g(a,b)=a+b$. Then $\nabla g=<1,1>$ and $\nabla P=<b,a>$. Then there exists a real number $\lambda$ such that $\nabla P=\lambda\nabla g$. It follows that $a=b$ and since $g(a,b)=x$, we have $a=b=\frac{x}{2}$.
Using Lagrange here looks like "killing a fly with a rocket launcher" but it is a powerful method in many situations.
Edit: this works for real solutions. For questions about natural numbers, calculus is not the best tool (at least need further discussions).
A: Use AM-GM inequality. From it we have:
$$\frac{a+b}{2} \ge \sqrt{ab}$$
$$\left(\frac{x}{2}\right)^2 \ge ab$$
$$\frac{x^2}{4} \ge ab$$
From this we can see that the $f(a,b) = ab$ for constrain $g(a,b) = a + b - x = 0$ is bounded from above, it's upper limit is $\frac{x^2}{4}$. Knowing AM-GM inequality property we know that the equality hold when $a=b$, so the maximum value can be reached when $a=b=\frac{x}{2}$
