# Minimum value of a function with two variables.

Suppose I have a curve (for example $(x-2)^2 + (y-2)^2 = 1$. I want to find the point on the curve where $x+y$ (or any other expression say $x^2+y^2$ ) is minimum. How can I do it ?

P.S:- I know the method to find minimum and maximum for a two variable function but I don't understand the above case.

• First you say that you don't know how to do it in a general way, then you specify that you know how to do that and you just don't know how to do it for $f(x, y) = x + y$. What do you want exactly? – rubik Jan 25 '17 at 19:39
• Unless the function itself is $x+y$ (or any other expression say $x^2+y^2$), it doesn't make sense to "find the point on the function" where that expression is minimum. For instance, it doesn't make sense to "find the point on the function $f(x, y) = x^2+y^2$ where the expression $x+y$ is minimum". – Arthur Jan 25 '17 at 19:53
• I'm sorry about the ambiguity I caused. I have made it much clearer now. – Accidental Genius Jan 25 '17 at 20:22
• Lagrange multipliers or substitution. – Ahmed S. Attaalla Jan 25 '17 at 20:23


With the parametrization $\ds{x = 2 + \cos\pars{\theta}}$,$\ds{\quad y = 2 + \sin\pars{\theta}}$:

1. \begin{align} x + y & = 4 + \cos\pars{\theta} + \sin\pars{\theta} = 4 + \root{2}\cos\pars{\theta - { \pi \over 4}} \\[5mm] & \implies \bbx{\ds{4 - \root{2}\ \leq\ x + y\ \leq\ 4 + \root{2}}} \end{align}
2. \begin{align} x^{2} + y^{2} & = 9 + 4\sin\pars{\theta} + 4\cos\pars{\theta} = 9 + 4\root{2}\cos\pars{\theta - {\pi \over 4}} \\[5mm] & \implies \bbx{\ds{9 - 4\root{2}\ \leq\ x^{2} + y^{2}\ \leq\ 9 + 4\root{2}}} \end{align}

A) Consider the extremal values of $x^2 + y^2$ for points on the circle.

A bit Geometry:

$(x-2)^2 + (y-2)^2 = 1$ is a circle with center $(2,2)$ and radius $= 1$.

The straight line $y = x$ is a symmetry axis for this circle, it passes through $(0,0)$ and the centre $(2,2)$, and intersects the circle twice.

For any point $(x,y)$ on the circle, $(x^2 + y^2)$ is the squared distance from the origin.

The shortest and longest squared distances from $(0,0)$ to the circles are the points of intersection of the line $y = x$ with the circle:

$$(x-2)^2 + (y-2)^2 = 1\tag 1$$

$$y = x \tag 2$$ Combining $(2)$ and $(1)$ gives:

$$(x-2)^2 + (x-2)^2 = 1$$

$$2 \times (x-2)^2 = 1 ;$$

Two solutions:

$$x_1 = 2 - \frac {\sqrt 2} 2$$ $$x_2 = 2 + \frac {\sqrt 2} 2$$

$y_1 = x_1$ and $y_2 = x_2$ (cf. eq. 2)

Min squared distance :

$$(x_1)^2 + (y_1)^2 = 2 \times (x_1)^2 = 2 \times ( 4 + \frac 1 2 - 2 \sqrt 2) = 9 - 4 \sqrt 2$$

Max squared distance :

$$(x_2) ^2 + (y_2)^2 = 9 + 4 \sqrt 2$$

$$9 - 4\sqrt 2 \le x^2 + y^2 \le 9 + 4 \sqrt 2$$

B) Now to the extremal values for $x + y$ for points on the circle.

Consider the straight line

$$y = - x + C\tag;$$

where $C$ is the $y$-intercept, i.e. y-value for $x = 0$. This line is perpendicular to the axis of symmetry $y = x$.

Points of intersection of $y = - x + C$ with the circle, are $(X,Y)$, inserting :

$Y+ X = C$

So finding the smallest and largest y- intercept $C$, with $y = -x + C$ intersecting the circle, will solve the problem.

$C (min)$ : $y = -x +C$ passes through $(x_1,y_1)$ .

$C( max)$: $y= -x + C$ passes through $(x_2,y_2)$.

Inserted:

$$C( min) = 2\times( 2 - \frac{\sqrt2}2);$$

$$C( max) = 2\times(2 + \frac{\sqrt2}2).$$

Finally we get:

$4 - \sqrt2 \le x + y \le 4 + \sqrt2$