Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to find $P(x,y)$ such that sum of squares of distance to points $A(3,4), B(20,8), C(4,24)$ is minimized. So I had a general expression of distance,

$D_\alpha = \sqrt{(x_\alpha - x_P)^2 + (y_\alpha - y_P)^2}$

Then the sum is:

$S = D^2_A + D^2_B + D^2_C$ $= (x_A - x_P)^2 + (y_A - y_P)^2 + (x_B - x_P)^2 + (y_B - y_P)^2 + (x_C - x_P)^2 + (y_C - y_P)^2$

Now it becomes a 8 variable function? Is it correct?

If so to find the critical points I need $$S_{x_A}, S_{y_A}, S_{x_B}, S_{y_B}, S_{x_C}, S_{y_C}, S_{x_P}, S_{y_P}$$

Or is there an easier way?

share|cite|improve this question
up vote 2 down vote accepted

So you have to find $P(x,y)$ such that :$\displaystyle \sum_{i=1}^3 d^2_i$ is a minimal , where :




Hence :

$\displaystyle \sum_{i=1}^3 d^2_i=3x^2_P+3y^2_P-54x_P-72y_p+1081$

In order to find minimum of this function you have to find critical points and after that to apply following theorem .

share|cite|improve this answer

It is a 2 variable problem, the values of $x_A,y_A,x_B,y_B,x_C,y_C$ are all provided ($A,B,C$ above), the only unknowns are $x_P,y_P$. To find the solution, you need to compute $\frac{\partial S}{\partial x_P}$ and $\frac{\partial S}{\partial y_P}$.

share|cite|improve this answer

This is an optimization problem with two unknown variables, $x_P$ and $y_P$. The other point variables are considered to be constants. The goal is to minimize the quantity $S$, sometimes called the objective function. Since this is a homework problem, a good approach is to start by asking yourself the following:

  • Does minimizing the objective result in a single correct solution or many?
  • What property(ies) exist at the solution of the minimization, or at any optimization program? Hint: use your multivariable calculus here.
  • Can you use these properties to create an equation or expression that will help you compute the solution values?
share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.