Derivative of a function involving square root of sum of squares

Click For Summary

Discussion Overview

The discussion revolves around the derivative of a function defined as the sum of Euclidean distances in a two-dimensional space, specifically focusing on how to derive this function and the implications for minimizing it given a set of points. The scope includes mathematical reasoning and exploration of optimization techniques in a multi-dimensional context.

Discussion Character

  • Mathematical reasoning
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant presents the function f(x) as the sum of Euclidean distances and seeks a method to derive it.
  • Another participant provides a mechanical derivation of the derivative of the Euclidean norm, leading to a formula for df/dx.
  • A subsequent participant raises the challenge of minimizing f(x) in multiple dimensions and questions the nature of the minimizer given specific 2D parameters.
  • Another participant suggests that the minimization problem becomes complex when considering three points in 2D, noting specific geometric conditions that affect the minimizer.
  • One participant questions whether the minimizer would remain the same if the square root is omitted from the function.
  • A later reply clarifies that squaring the terms does not affect the minimization of the function itself, suggesting that the barycenter minimizes the sum of squared distances but is uncertain about the sum of distances.
  • Another participant asserts that minimizing the distance to a curve is equivalent to minimizing the squared distance, emphasizing that least squares problems are formulated for ease of calculation.

Areas of Agreement / Disagreement

Participants express differing views on the implications of squaring the function versus using the square root, leading to an unresolved discussion about the nature of the minimizer in relation to these formulations. There is no consensus on the equivalence of the minimizers for the different formulations of the function.

Contextual Notes

The discussion includes various assumptions about the geometry of the points involved and the conditions under which the minimization occurs, which are not fully resolved. The implications of dimensionality and specific configurations of points are also noted but remain open to interpretation.

onako
Messages
86
Reaction score
0
Provided is a function f(x)=\sum_{j=1}^n ||x-x_j||, for x being a two dimensional vector, where ||.|| denotes the Euclidean distance in 2D space. How could one obtain a derivative of such a function?
 
Physics news on Phys.org
If you are just looking for a mechanical derivation I think you can do in this way. If ||\cdot|| is the Euclidean norm then:

$$||x-x_j||=\sqrt{\sum_{k=1}^N{{(x-x_j)}_k^2}}$$

where N is the dimension of the Euclidean space. So:

$$\frac{d}{dx}||x-x_j||=\frac{1}{2\sqrt{\sum_{k=1}^N{{(x-x_j)}_k^2}}}\sum_{k=1}^N{2{(x-x_j)}_k}=\frac{\sum_{k=1}^N{{(x-x_j)}_k}}{||x-x_j||}$$

and so:

$$\frac{df}{dx}=\sum_{j=1}^n{\frac{\sum_{k=1}^N{{(x-x_j)}_k}}{||x-x_j||}}$$
 
Thanks. Now, faced with the problem of minimizing f(x) for provided 2D parameters x1, x2, x3, ..., x_k, one sets the derivative to zero, and computes for x. However, in case of more than one dimension this problem is non-trivial, I think. What would be the minimizer of f(x), provided 2D parameters x1, x2, x3, ..., x_k?
 
That it will be messy can be seen by considering just 3 points in 2 dimensions. If any pair subtends an angle > 120 degrees at the third then the answer will be that third point. Otherwise, it is the point at which each pair subtends that angle.
 
Won't the minimizer be the same if you don't take the square root?
 
It then means you're squaring each term, and not the function itself. If a function is squared, then these would be equivalent.

Given a set of points in 2D, a point that minimizes the sum of squared distances to such points is the barycenter; I'm not sure about the sum of distances (so, not squared).
 
All I'm saying is that I believe

$$f(x)=\sqrt{g(x)^2}$$

has the same minimizer as

$$f(x)^2 = g(x)^2$$

I remember from basic calculus that minimizing the distance from a point to a curve is the same as minimizing the distance squared, which is a lot easier to deal with. I think that's also why least squares problems are specifically formulated the way they are. Minimizing the sum of squares is a whole lot easier than minimizing the square root of the sum of squares, and yields the same answer.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 21 ·
Replies
21
Views
3K