# Derivative of summation

1. Apr 10, 2010

### rider-pt

Hello,

Could you help me derive this function, so I can find the minimum of it.

$$z=\sum_{i=1}^{n}{\sqrt{\left( x-x_{i} \right)^{2}+\left( y-y_{i} \right)^{2}}}$$

Thank you.

2. Apr 10, 2010

### D H

Staff Emeritus
This looks like homework. We help you do your own homework; we do not do it for you.

3. Apr 10, 2010

### rider-pt

It is not homework. It is just some curiosity of mine.

What I want to do is find the point $$(x,y)$$, that has the smallest sum of distances to a series of points $$(x_{1},y_{1})$$, $$(x_{2},y_{2})$$, $$(x_{3},y_{3})$$, ...,$$(x_{n},y_{n})$$. Something like a centre of gravity.

I don't need just the result, I would like to see the path to it.

Thank you.

4. Apr 10, 2010

### Redbelly98

Staff Emeritus
Welcome to Physics Forums.
Thanks for the clarification, it makes a difference in how we approach helping you. There are designated homework subforums (not this one however) that some new members ignore.

First, realize that there is not necessarily a unique solution to this. Consider a set of just 2 points. Any point on the line segment joining them will have the same sum-of-distances.

That being said, you would take the partial derivatives of z with respect to both x and y, set each equal to zero, and solve the two equations you get.