Finding minimum point of a function using linear algebra Given a function $$q(x,y)=2x^2-2xy +2y^2$$.
Find the minimum point of the following function by first converting it to a matrix form and using the diagonalisation of the matrix to find its minimum point. (I know its easy just by using the usual method. But the point is that i want to learn how to use linear algebra using this question as an example.)  
What i did was to express the function in matrix form $A$. 
              $$A=\begin{pmatrix}2&-1\\-1&2
\end{pmatrix}.$$
Then using the diagonalisation formula in linear algebra  where $$D=P^TAP$$  I find the eigenvector of A which is  
$$P=\begin{pmatrix}1&-1\\1&1
\end{pmatrix}.$$
and do a matrix multiplication to find D. Im stuck at this
From this point onwards.
I know that after finding D,
$$q(x,y)=x^TAx=x^TPDP^Tx=(P^Tx)^TDP^Tx=x'^TDx'^T$$
And i need to change it to a rotated coordinate system x'y' but how exactly to go about doing it from here. I know that after the rotation the expression becomes $$x^2+3y^2$$. But how to get there? Could anyone explain

First you define as you do a new variable:
$$x'=P^T x$$
In the new coordinate system you have:
$$q(x')=x'^TDx'=\begin{pmatrix}x' & y'\end{pmatrix}\begin{pmatrix}d_1&0\\0&d_2
\end{pmatrix}\begin{pmatrix}x'\\y'
\end{pmatrix}=d_1x'^2+d_2y'^2$$
If $d_1$ and $d_2$ are positive the minimum is when $(x' y')=(0,0)$ therefore you have to solve when $P^Tx=0$
