I am totally desperate, because I am not able to solve following task. I really appreciate any help. I've already tried to solve that for hours....
Be $G_1 = \{a+tv \mid t∈\mathbb{R}\}$ and $G_2 = \{b+tw \mid t∈\mathbb{R}\}$ two lines in $\mathbb{R}^n$ given by two points $a,b$ and direction vectors $v,w$. Find two points $m_1∈G_1$ and $m_2∈G_2$, so that the euclidean distance between them is minimal.
Formulate this problem as a convex minimization problem without constraints.and solve it afterwards.
Thank you in advance.
Calling
$$ f(t_{1},t_{2})=\left\Vert a+t_{1}v-(b+t_{2})\right\Vert ^{2}=\left\Vert a-b\right\Vert ^{2}+t_{1}^{2}\left\Vert v\right\Vert ^{2}+t_{2}^{2}\left\Vert w\right\Vert ^{2}-2t_{1}t_{2}\left\langle v,w\right\rangle +2t_{1}\left\langle v,a-b\right\rangle -2t_{2}\left\langle w,a-b\right\rangle $$
we have
$$ \nabla f(t_{1},t_{2})=\left(\begin{array}{c} 2t_{1}\left\Vert v_{1}\right\Vert ^{2}-2t_{2}\left\langle v,w\right\rangle +2\left\langle v,a-b\right\rangle \\ 2t_{2}\left\Vert w\right\Vert ^{2}-2t_{1}\left\langle v,w\right\rangle -2\left\langle w,a-b\right\rangle \end{array}\right)=\left(\begin{array}{c} 0\\ 0 \end{array}\right) $$
and solving for $t_{1},t_{2}$ we obtain $t_{1}^{*},t_{2}^{*}$ such that $d=\sqrt{f(t_{1}^{*},t_{2}^{*})}$