The square of a real number is always non-negative, and is zero only when the number itself is zero. What could be more straightforward? Combine this trivial result with the familiar identity for the square of a sum, namely (a + b)2 = a2 + 2 ab + b2, and we can already tackle a good many optimization problems. The basic idea can be seen in the problem of maximizing the product of two numbers with a given sum. Denote the given sum by 2a, and the two numbers by x and y. They satisfy x + y = 2a, allowing us to express y in terms of x, and hence the product xy as 2axx2. The identity above suggests introducing the square (xa)2. This gives xy = a2 – (xa)2. Since (xa)2 is always non-negative and is zero only when x = a, it follows that the maximum of xy is a2, attained only when x and y are equal.
The same idea can be used to find the minimum sum of two positive numbers with a given product. Simply write the product and the two numbers as squares of positive numbers: a2, x2 and y2. The equality x2y2 = a2 implies that xy = a. Using the same identity, the sum of the two numbers can be written as x2 + y2 = (xy)2 + 2xy, and hence as x2 + y2 = (xy)2 + 2a. The minimum sum is therefore 2a, and it is attained only when x and y are equal.
This result gives the minimum of the function f on (0, +∞), defined by:
f(x)=x+a2x.f(x)=x+\dfrac{{a}^{2}}{x}.