Derivative with respect to x_i (multiple dimension)

62 Views Asked by At

We have the following where $x_i$ is two-dimensional. The optimization problem has no constraints (aka prob not using Lagrange) ... but rather it's to minimize the following function... $ \sum_{i,j}(||x_i - x_j||-D_{ij})^2$ where $D_{ij} \geq 0 \in \mathbb{R}$ aka some constant distances between locations and $x_i$ is location A while $x_j$ would represent location B. From 1st sentence, $x_i$ or $x_j$ would be a location with x and y coord.

What is the derivative of the above with respect to $x_i$.

2nd guess is that since $ (∥x_i−x_j∥−D_{ij})^2=∥x_i−x_j∥^2−2D_{ij}∥x_i−x_j∥+D^2_{ij}$ then we can evaluate the norms to be left with $\sum_{i,j}\bigg[(x_i -x_j)^2 -2D_{ij}\sqrt{(x_i -x_j)^2}+D^2_{ij} \bigg]$ and the derivative w.r.t. $x_i$ is just $\sum_{i,j}\bigg[(x_i^2 -2x_j) -2D_{ij}\bigg]$ ... Having trouble simplifying further aka getting rid of the summation (is it legal to even take that derivative passing over the summation ... or was there an identity of summations to consider)?