Home » Blog » If x+y is fixed prove x2+y2 is minimal when x = y

If x+y is fixed prove x2+y2 is minimal when x = y

If x + y = S > 0 is fixed, prove that x = y minimizes the sum x^2 + y^2, where x and y are positive real numbers.


Proof. Since x + y = S we have y = S - x. Then, we want to minimize the function

    \[ f(x) = x^2 + (S - x)^2. \]

Taking the derivative we have

    \[ f'(x) = 2x - 2 (S-x) = 4x - 2S. \]

This means f'(x) = 0 when x = \frac{S}{2} and we have

    \begin{align*}  f'(x) &< 0 & \text{when} && x &< \frac{S}{2} \\  f'(x) &> 0 & \text{when} && x &> \frac{S}{2}. \end{align*}

Therefore, f is decreasing for x < \frac{S}{2} and increasing for x > \frac{S}{2}. Hence, f(x) has a minimum at x = \frac{S}{S}. This implies

    \[ y = S - x = S - \frac{S}{2} = \frac{S}{2}. \]

Hence, the sum is minimal when

    \[ x = y. \qquad \blacksquare \]

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):