Inner product, smallest distance I have an old exam question I need help with before my upcoming exam:
Let $u = (x_1, y_1)$ and $v = (x_2,y_2)$.
Define an inner product in $\mathbb{R}^2$, $\langle u, v\rangle =2x_1x_2+x_1y_2+x_2y_1+3y_1y_2$.
Now I want to find the distance between the line $x+y=1$ and $(0,0)$
My attempt: Let $u=(x,y)$ be the vector we're looking for, $\langle u, u\rangle =2x^2+2xy+3y^2$, call this $B$, so the norm is $\frac{1}{\sqrt{B}}$.
I think there should be a way to do this by diagonalizing the matrix $A$, which is the matrix for our polynomial. So we get $A=T^{-1}DT$, then make a variable-substitution $(u,v)=(x,y)T$ to eliminate the $2xy$-term in our polynomial, then use $x+y=1$ to solve for the smallest value. Is this correct?
Is there any shorter solution I can do? Like using $x+y=1$ directly on $2x^2+2xy+3y^2$?
Bare with my english, but plz let me know where my mathematical notation is wrong!
Thx
 A: The shortest distance between a fixed point $a$ off a line and a variable point $b$ on a line occurs when $b - a$ is perpendicular to the line.  In this case the line $x+y=1$ can be expressed with the inner product as $$\ell = \{ (x, y)  \mid x+y = 1\} = \{ u \mid \langle u, (2, 1) \rangle = 5 \}.$$ In this last form it is clear that $(2,1)$ is perpendicular to $\ell$.  The point closest to $(0,0)$ is therefore the intersection of $\ell$ with the line through $(0,0)$ and $(2,1)$.  Then use the inner product again to find the distance between that point and $(0,0)$.
A: I am not sure what you mean by the matrix of a polynomial, so I'm afraid I can't answer the question directly. 
A way that makes use of the linear algebra you know is to choose some vector on the line, which will have the form $\mathbf{x}=\begin{bmatrix} x \\ 1-x \end{bmatrix}$. If a vector points along the shortest distance from a point to a line, it will necessarily be orthogonal to the line.
We know that the line has its "slope" vector to be $\mathbf{m}=\begin{bmatrix} 1 \\ -1 \end{bmatrix}$. Therefore, when we set the inner product $\langle\mathbf{x},\mathbf{m}\rangle=0$, we get 
\begin{align}
2x-x(1-x)+(1-x)-3 &= 0 \\
x^2+2x-2x+1-3 &=0 \\
x^2 &= 2 \\
x &= \pm \sqrt2
\end{align}
Thus, the desired vector is $\begin{bmatrix} \sqrt2 \\ 1-\sqrt2 \end{bmatrix}$, and so the distance is the square root of the inner product with itself:
\begin{align}
\langle\mathbf{x},\mathbf{x}\rangle &= 2(\sqrt2)^2+2\sqrt2(1-\sqrt2)+3(1-\sqrt2)^2 \\
 & = 4 + 2\sqrt2 - 4 + 3(3-2\sqrt2) \\
 & = 9 - 4\sqrt2,
\end{align}
which is $\sqrt{9-4\sqrt2} = 2\sqrt2 -1$.
