# Minimum of sum of squares

#### sweatingbear

##### Member
Problem:
The sum of two real numbers is $$\displaystyle 1$$. What is the minimum value of the sum of the squares of the two numbers?

I have already managed to solve the problem algebraically (by substitution and completing-the-square we arrive at a minimum value of $$\displaystyle 0.5$$), but what I am interested in is a graphical approach.

We have $$\displaystyle x +y = 1$$ and wish to find the minimum of $$\displaystyle x^2 + y^2$$, which we can call $$\displaystyle f(x,y)$$. So we have

$$\displaystyle \begin{cases} x +y = 1 \\ x^2 + y^2 = f(x,y) \, . \end{cases}$$

In a (cartesian) coordinate system these two equations represent a line and a circle respectively. Therefore the problem boils down to figuring out what the minimum radius of the circle is $$\displaystyle x^2 + y^2 = f(x,y)$$, but this is where I am unable to continue. How can one graphically find the minimum radius of the circle?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Problem:
The sum of two real numbers is $$\displaystyle 1$$. What is the minimum value of the sum of the squares of the two numbers?

I have already managed to solve the problem algebraically (by substitution and completing-the-square we arrive at a minimum value of $$\displaystyle 0.5$$), but what I am interested in is a graphical approach.

We have $$\displaystyle x +y = 1$$ and wish to find the minimum of $$\displaystyle x^2 + y^2$$, which we can call $$\displaystyle f(x,y)$$. So we have

$$\displaystyle \begin{cases} x +y = 1 \\ x^2 + y^2 = f(x,y) \, . \end{cases}$$

In a (cartesian) coordinate system these two equations represent a line and a circle respectively. Therefore the problem boils down to figuring out what the minimum radius of the circle is $$\displaystyle x^2 + y^2 = f(x,y)$$, but this is where I am unable to continue. How can one graphically find the minimum radius of the circle?
Hi sweatingbear!

Consider all concentric circles around zero.
You're interested in the smallest one, which would just touch the line y=1-x.
Due to the symmetry of the problem in the line y=x, the point where the circle would touch the line y=1-x will be at the point where y=x.
This is x=y=1/2.

Here's a picture to clarify.

Last edited:

#### MarkFL

Staff member
One way, is to let $y=1-x$ in the equation of the circle:

$$\displaystyle x^2+(1-x)^2=r^2$$

$$\displaystyle 2x^2-2x+1-r^2=0$$

Now, the minimum possible radius requires the discriminant to be zero (do you see why?), and so we get:

$$\displaystyle (-2)^2-4(2)(1-r^2)=0$$

$$\displaystyle r^2=\frac{1}{2}$$

and we find:

$$\displaystyle 4x^2-4x+1=0$$

Hence:

$$\displaystyle (x,y)=\left(\frac{1}{2},\frac{1}{2} \right)$$

#### sweatingbear

##### Member
Hi sweatingbear!

Consider all concentric circles around zero.
You're interested in the smallest one, which would just touch the line y=1-x.
Due to the symmetry of the problem in the line y=x, the point where the circle would touch the line y=1-x will be at the point where y=x.
This is x=y=1/2.

Here's a picture to clarify.
View attachment 991
Let me see if I got it straight: In the coordinate system the sum of the squares can be visualized as the squared value of the radius of the circle. Should we wish to minimize the squared value of the radius then that is equivalent to the task of minimizing the radius of the circle. Moreover the only points of interest are those where the circle intercepts the line because those are the only one points where the sum of $$\displaystyle x$$ and $$\displaystyle y$$ is $$\displaystyle 1$$.

So the task at hand is to find a point (or points) where the circle intersects the line and where the distance between the point in question and (0,0) is as small as possible. We can trivially conclude that this point must be where the circle tangentially intersects the line because otherwise the points will be at an arbitrarily large distance away from (0,0).

Any thoughts on that, I Like Serena?

One way, is to let $y=1-x$ in the equation of the circle:

$$\displaystyle x^2+(1-x)^2=r^2$$

$$\displaystyle 2x^2-2x+1-r^2=0$$

Now, the minimum possible radius requires the discriminant to be zero (do you see why?), and so we get:

$$\displaystyle (-2)^2-4(2)(1-r^2)=0$$

$$\displaystyle r^2=\frac{1}{2}$$

and we find:

$$\displaystyle 4x^2-4x+1=0$$

Hence:

$$\displaystyle (x,y)=\left(\frac{1}{2},\frac{1}{2} \right)$$
Continuing on from the discourse above: Since we were able to conclude that the circle ought to tangentially intercept the line, this means that it intersects the line at one and only one point. Thus we will have to require that the discriminant is equal to zero (otherwise the circle will not tangentially intercept the line; either not at all or at two distinct points) which finally yields $$\displaystyle r = 0.5$$. Is that a sufficient answer for "why" or were you thinking of a different answer, MarkFL?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Let me see if I got it straight: In the coordinate system the sum of the squares can be visualized as the squared value of the radius of the circle. Should we wish to minimize the squared value of the radius then that is equivalent to the task of minimizing the radius of the circle. Moreover the only points of interest are those where the circle intercepts the line because those are the only one points where the sum of $$\displaystyle x$$ and $$\displaystyle y$$ is $$\displaystyle 1$$.

So the task at hand is to find a point (or points) where the circle intersects the line and where the distance between the point in question and (0,0) is as small as possible. We can trivially conclude that this point must be where the circle tangentially intersects the line because otherwise the points will be at an arbitrarily large distance away from (0,0).

Any thoughts on that, I Like Serena?
Yep. That's right.

#### MarkFL

Staff member
...
Continuing on from the discourse above: Since we were able to conclude that the circle ought to tangentially intercept the line, this means that it intersects the line at one and only one point. Thus we will have to require that the discriminant is equal to zero (otherwise the circle will not tangentially intercept the line; either not at all or at two distinct points) which finally yields $$\displaystyle r = 0.5$$. Is that a sufficient answer for "why" or were you thinking of a different answer, MarkFL?
Yes, that is correct.

#### sweatingbear

##### Member
Thanks, both of you!

#### Prove It

##### Well-known member
MHB Math Helper
One way, is to let $y=1-x$ in the equation of the circle:

$$\displaystyle x^2+(1-x)^2=r^2$$

$$\displaystyle 2x^2-2x+1-r^2=0$$
Since this is a minimisation problem, I expect that calculus is required.

If we call the sum of squares \displaystyle \displaystyle \begin{align*} S = x^2 + y^2 = x^2 + \left( 1 - x \right) ^2 = 2x^2 - 2x + 1 \end{align*} then the minimum is where the derivative is 0 and the second derivative is positive.

\displaystyle \displaystyle \begin{align*} \frac{dS}{dx} &= 4x - 2 \\ 0 &= 4x - 2 \\ 2 &= 4x \\ \frac{1}{2} &= x \\ \\ \frac{d^2S}{dx^2} &= 4 \\ &> 0 \end{align*}

So there is a minimum where \displaystyle \displaystyle \begin{align*} x = \frac{1}{2} \end{align*}, and so \displaystyle \displaystyle \begin{align*} y = 1 - \frac{1}{2} = \frac{1}{2} \end{align*}. So the minimum sum of squares is when the two numbers are both \displaystyle \displaystyle \begin{align*} \frac{1}{2} \end{align*}, and this sum is \displaystyle \displaystyle \begin{align*} \left( \frac{1}{2} \right) ^2 + \left( \frac{1}{2} \right) ^2 = \frac{1}{4} + \frac{1}{4} = \frac{1}{2} \end{align*}.

#### MarkFL

Staff member
With a quadratic function, optimization can be accomplished simply by locating the axis of symmetry. Given:

$$\displaystyle 2x^2-2x+1-r^2=0$$

We find the axis of symmetry at:

$$\displaystyle x=-\frac{-2}{2\cdot2}=\frac{1}{2}$$

Knowing the parabolic function has a positive coefficient on its squared term, we can then conclude it has a minimum at $x=\dfrac{1}{2}$.

#### johng

##### Well-known member
MHB Math Helper
Hi sweatingbear,
An object function f(x,y)
A constraint equation g(x,y)=0
The problem is to find the minimum value of f(x0,y0) for all points (x0,y0) on the curve g(x,y)=0.
Assume all curves involved are "nice and smooth"; however they need not be connected.

1. If you can solve g(x,y)=0 for y, say y=h(x), graph the function f(x,h(x)). Find the lowest point on this graph. In your example y=h(x)=1-x, so graph x2+(1-x)2 and find the lowest point to be (1/2,1/2). The desired minimum is then 1/4. "Usually" you can't solve the constraint equation for y.
2. Graph the constraint curve g(x,y)=0 and for different values of m, graph the curve f(x,y)=m. If the two curves don't intersect, no point (x,y) of the constraint can have value f(x,y)=m. Otherwise, graphically try and find the smallest m where the curves intersect. (You need a good graphing calculator or graphing software with a slider for m to do this.) It turns out for "smooth" curves, this minimum occurs at a point (x0,y0) with the tangent lines to the two curves at this point the same! If you go on to calculus, this is the basis for the "Lagrange multiplier method".

I've attached a graph which shows the situation in 2. To really appreciate how this works, you need to do it yourself.

#### Attachments

• 38.7 KB Views: 16