# Math Help - Difficult vector question

1. ## Shortest distance between point and line, dot product

Let B be a point $\mathbb{R}^n$ with coordinate vector $\mathbf{b}$. Let $\mathbf{x=a+\lambda d}$, $\lambda \in \mathbb{R}$ be the equation of a line.

1) Show that the square of the distance from B to an arbritrary point $\mathbf{x}$ on the line is given by:

$q(\lambda)=|\mathbf{b}-\mathbf{a}|^2-2\lambda(\mathbf{b}-\mathbf{a}) \cdot \mathbf{d}+ \lambda^2 |\mathbf{d}|^2$

2) Find the shortest distance between the point B and the line by minimising $q(\lambda)$

3) If P is the point on the line closest to B, show that:

$
\vec{PB}=\mathbf{b} - \mathbf{a} - proj_{\mathbf{d}}(\mathbf{b} - \mathbf{a})$
, and show that $\vec{PB}$ is orthogonal to the direction $\mathbf{d}$ of the line