# Homework Help: I found this inequality but I don't know where it comes from

1. Oct 2, 2013

### Felafel

here is the inequality:
$(\sum\limits_{i=1}^n |x_i-y_i|)^2= \ge \sum\limits_{i=1}^n(x_i-y_i)^2+2\sum\limits_{i \neq j}^n |x_i-y_i|\cdot |x_j-y_j|$
does it have a name/is the consequence of a theorem?
Thank you :)

2. Oct 2, 2013

3. Oct 2, 2013

### jbunniii

I believe it is actually an equality, assuming you mean the following:
\begin{align} \left(\sum_{i=1}^{n}|x_i - y_i|\right)^2 &= \sum_{i=1}^{n} \sum_{j=1}^{n} |x_i - y_i|\cdot |x_j - y_j| \\ &= \sum_{i=1}^{n} |x_i - y_i|^2 + \sum_{i=1}^{n} \sum_{j\neq i,j=1}^{n} |x_i - y_i|\cdot |x_j - y_j|\\ &= \sum_{i=1}^{n} |x_i - y_i|^2 + \sum_{i=1}^{n} \sum_{j=1}^{i-1} |x_i - y_i|\cdot |x_j - y_j| + \sum_{i=1}^{n} \sum_{j=i+1}^{n} |x_i - y_i|\cdot |x_j - y_j| \end{align}
By symmetry, the second two terms are equal to each other, so we have
$$\left(\sum_{i=1}^{n}|x_i - y_i|\right)^2 = \sum_{i=1}^{n} |x_i - y_i|^2 + 2\sum_{i=1}^{n} \sum_{j=1}^{i-1} |x_i - y_i|\cdot |x_j - y_j|$$
I don't know if this equality has a name, but it's a standard and often useful way to rewrite the left hand side.

4. Oct 2, 2013

### Staff: Mentor

its the triangle inequality. see the wiki article on it.

5. Oct 2, 2013

### D H

Staff Emeritus
Look at jbunniii's derivation, jedishrfu. It's an identity, not an inequality.