Problem: Show that $f: \mathbb{R}^n \times \mathbb{R}^n \to \mathbb{R}$ with $f(x,y)=\|x-y\|_2^2$ is differentiable and compute its differential at every point in the domain of $f$
Note: $\| \cdot \|_2$ denotes the euclidian norm $d(x,y)_2 =\sqrt{\sum\limits_{i=1}^n (x_i-y_i)^2}$
One exercise I found in Zorich Analysis II. I am however in general clueless on how to show that a function is differentiable. Of course there is always the brute force way such as computing the Jacobian-Matrix and discuss its entries, however that might be a little bit difficult with the above mapping since $f: \mathbb{R}^n \times \mathbb{R}^n \to \mathbb{R}$, that would be one hell of a matrix to compute.
I found that most people enjoy working with this definition of differentiability in $\mathbb{R}^n$
$f(x)=f(x_0)+A(x-x_0)+\|x-x_0\|\alpha (x)$ where $\alpha: U \to \mathbb{R}^n$ such that $\lim\limits_{x \to x_0} \alpha (x)=0$ and $A$ is a linear function.
I understand that the above is only a slight variation of:
Def: $f$ is at $x_0$ differentiable $\iff \exists A: \mathbb{R}^m \to \mathbb{R}^n: \displaystyle \lim_{x \to x_0} \frac{f(x)-f(x_0)-A(x-x_0)}{\|x-x_0\|}=0 $
In C.T. Michaels Analysis II the author mentions that by the definition nothing is known about the linear mapping $A$, however in most cases $A$ can easily be found by computing the Jacobian-Matrix and then verifying the definition with that Matrix.
I have read a couple of entries on this website where people attempt to show that a function is differentiable or not at some generic point. But to be honest it all seemed a bit like Voodoo-Magic to me.
Question: I am not primarily interested in the solution to this exercise but in the thought process one would have to show that $f$ defined as above is differentiable:
- Where do you start?
- Is there something in specific you have to notice about the function beforehand? Like symmetry, roots or anything to start discussing its differential.
- Is it a lot of lucky guessing and in the end succeeding after a lot of failed attempts? Or is there something like a 'most natural attempt' to generally solve such exercises.
Note this is the map $(x,y)\mapsto (x-y)\cdot (x-y)$, that is $(x,y)\mapsto x\cdot x-2x\cdot y+y\cdot y$. It suffices we show each of the summands is differentiable. But two of the summands are $\lVert \cdot \rVert ^2$; which we know how to differentiate, and the central summand is bilinear, so it is not too hard to obtain their derivative. In fact, we obtain that $$Df(x,y)(a,b)=2x\cdot a-2(x\cdot b+a\cdot y)+2 b\cdot y\\=2x\cdot(a-b)-2y\cdot(a-b)=2(x-y)\cdot (a-b)$$
Note that if $g(x,y)=x\cdot x$, then $Df(x,y)(a,b)=2x\cdot a$ and if $h(x,y)=y\cdot y$ then $Dh(x,y)(a,b)=2y\cdot b$. This is easily proven by say $$g(x+k,y+k)-g(x,y)=2x\cdot h+\lVert h\rVert ^2$$ $$h(x+k,y+k)-h(x,y)=2y\cdot k+\lVert k\rVert ^2$$ and noting $\lVert h\rVert,\lVert k\rVert \leqslant \lVert (h, k)\rVert$.
Proof I give the proof for the bilinear case, I leave the other proof out.
Indeed, suppose $B:\Bbb R^n\times\Bbb R^m\to\Bbb R^p$ is bilinear. Then $$B(x+h,y+k)=B(x,y)+B(x,k)+B(h,y)+B(h,k)$$
Thus $$B(x_0+h,y_0+k)-B(x_0,y_0)=B(x_0,k)+B(h,y_0)+B(h,k)$$
Let $A:\Bbb R^n\times \Bbb R^n\to\Bbb R $ be the map that sends $(a,b)$ to $B(x_0,b)+B(a,y_0)$. This is linear, and the above gives $$B(x_0+h,y_0+k)-B(x_0,y_0)=A(h,k)+B(h,k)$$
It suffices we show that $B(h,k)$ os $o(\lVert h,k\rVert)$. Let $e_i,e_j$ be the canonical bases for $\Bbb R^n,\Bbb R^m$. If $h=(h_1,\ldots,h_n),k=(k_1,\ldots,k_m)$ then $$B(h,k)=\sum_{i,j} h_ik_j B(e_i,e_j)$$ and $|h_j|,|k_i|\leqslant \lVert h,k\rVert$, so if $C=\sum_{i,j}\lVert B(e_i,e_j)\rVert $ (a constant depending only on $B$ and the basis of choice)
$$\lVert B(h,k)\lVert\leqslant C\lVert h,k\rVert^2$$