Hessian of function in $\mathbb R^2$ Consider the function $$f(x):=\frac{x-x_0}{\Vert x-x_0 \Vert^2} + \frac{x-x_1}{\Vert x-x_1 \Vert^2}$$
for two fixed $x_0,x_1 \in \mathbb R^2$ and $x \in \mathbb R^2$ as well. 
Does anybody know what the Hessian of the function 
$$g(x):=\Vert f(x) \Vert^2$$ 
is? It is such a difficult composition of functions that I find it very hard to compute.
The bounty is for a person who fully derives the Hessian of $f. $ Please let me know if you have any questions.
 A: Avoid coordinates. Here's a solution that works with all dot products in any dimension: 
Define $h_k(x)=\frac{x-x_k}{\|x-x_k\|^2}$ for $k\in\{0,1\}$.
Then we have
$\|h_k(x)\|^2=1/\|x-x_k\|^2$ and
$$d_ph(x)=p\|h_k(x)\|^2-2h_k(x)\langle p,h_k(x)\rangle$$
and$$d_p\|h_k(x)\|^2=-2\|h_k(x)\|^2\langle p,h_k(x)\rangle.$$
After a straightforward calculation I get
$$\frac12\nabla g(x)=\bigl(\|h_0(x)\|^2-\|h_1(x)\|^2\bigr)\cdot\bigl(h_1(x)-h_0(x)\bigr)-2\langle h_0(x),h_1(x)\rangle\bigl(h_0(x)+h_1(x)\bigr).$$
From here feel free to calculate the Hessian: Differentiating $\frac12\nabla g(x)$ again at $q$ we get (omitting the argument $x$ for the sake of readability)
$$\begin{align}
-&q\left(2\langle h_0,h_1\rangle(\|h_0\|^2+\|h_1\|^2)+(\|h_0\|^2-\|h_1\|^2)^2\right)\\
+&h_0\langle q,4h_0\|h_0\|^2-(2h_0+h_1)\|h_1-h_0\|^2\rangle\\
+&h_1\langle q,4h_1\|h_1\|^2-(2h_1+h_0)\|h_0-h_1\|^2\rangle,
\end{align}
$$
hence the Hessian at $(p,q)$ is
$$\begin{align}
2\langle p,-&q\left(2\langle h_0,h_1\rangle\|(h_0\|^2+\|h_1\|^2)+(\|h_0\|^2-\|h_1\|^2)^2\right)\\
+&h_0\langle q,4h_0\|h_0\|^2-(2h_0+h_1)\|h_1-h_0\|^2\rangle\\
+&h_1\langle q,4h_1\|h_1\|^2-(2h_1+h_0)\|h_0-h_1\|^2\rangle\rangle.
\end{align}
$$
A: If you choose ${\bf x}_0$ and ${\bf x}_1$ at $(\pm a,0)$ of the $(x,y)$-plane you have
$$f(x,y)={(x+a,y)\over(x+a)^2+y^2}+{(x-a,y)\over(x-a)^2+y^2}\ .$$
In the following Mathematica notebook ${\tt gxx}$, ${\tt gxy}$, ${\tt gyy}$ are the entries of the Hessian matrix
$$\left[\matrix{g_{xx}&g_{xy}\cr g_{xy}&g_{yy}\cr}\right]\ .$$
Here is the result:

A: Well, you can just compute $g(x)$... I'll denote $x_0,x_1$ by $u,v$.
$$
f(x) = \frac{x-u}{\|x-u\|^2}+\frac{x-v}{\|x-v\|^2}=\left(\frac{x_1-u_1}{(x_1-u_1)^2+(x_2-u_2)^2}+\frac{x_1-v_1}{(x_1-v_1)^2+(x_2-v_2)^2}, \right.
$$
$$
\left.\frac{x_2-u_2}{(x_1-u_1)^2+(x_2-u_2)^2}+\frac{x_2-v_2}{(x_1-v_1)^2+(x_2-v_2)^2} \right)
$$
and so,
$$
g(x)=\left(\frac{x_1-u_1}{(x_1-u_1)^2+(x_2-u_2)^2}+\frac{x_1-v_1}{(x_1-v_1)^2+(x_2-v_2)^2}\right)^2+
$$
$$
\left(\frac{x_2-u_2}{(x_1-u_1)^2+(x_2-u_2)^2}+\frac{x_2-v_2}{(x_1-v_1)^2+(x_2-v_2)^2} \right)^2
$$
Now you can compute the Hessian matrix. 
