What is the difference between using $PAP^{-1}$ and $PAP^{T}$ to diagonalize a matrix?
Can both methods be used to diagonalize a diagonalizable matrix $A$?
Also does $A$ been symmetric or not effect which method to use?
What is the difference between using $PAP^{-1}$ and $PAP^{T}$ to diagonalize a matrix?
Can both methods be used to diagonalize a diagonalizable matrix $A$?
Also does $A$ been symmetric or not effect which method to use?
You always use $PAP^{-1}$ to diagonalize a matrix, since this process (multiplying by $P$ on one side and $P^{-1}$ on the other) is effectively changing the basis of your matrix, and so is not changing many of the fundamental properties.
If $P^{-1} = P^T$ then $P$ is called an orthogonal matrix, and $PAP^{-1}$ is the same thing as $PAP^T$. A matrix is orthogonally diagonalizable (diagonalizable by an orthogonal matrix) if and only if it is symmetric.
The difference is the following: When you use the formula $$P A P^{-1}$$ is because you regard the matrix $A$ as the matrix of a linear map $f$. Then the above formula tell you how the matrix $f$ change when you change the coordinates i.e. the basis. Instead the formula $$P A P^{\top} $$ is used when you regard $A$ as the matrix of a quadratic form $q$. Then the above formula tell you how change the matrix of $q$ when you change the coordinates i.e. the basis.
So in order to perform a diagonalization you have to be aware if $A$ is the matrix of either a linear map or of a quadratic form. In the special that $P^{\top} = P^{-1}$ i.e. when $P$ is orthogonal both formulae agree. This happens in the traditional method of diagonalization of a symmetric matrix by means of it eigenvectors. But in order to diagonalize a quadratic form it is not necessary to use an orthogonal matrix $P$. Such diagonalization can be done by the traditional method of completing the square: https://en.wikipedia.org/wiki/Completing_the_square
When the original matrix is symmetric, and using $P^T A P,$ people do not seem to be aware of the extremely easy Hermite reduction, see Transforming quadratic forms, how is this theorem called?
Hermite reduction is just repeatedly completing the square, I did an easy one yesterday,
$$ xy - y^2 = \left( \frac{x}{2} \right)^2 - \left( \frac{x}{2} - y \right)^2 $$
at Diagonalizing quadratic forms
Let me work up an unpleasant ternary with all bad eigenvalues in https://en.wikipedia.org/wiki/Casus_irreducibilis , which just means three irrational eigenvalues for an integer matrix...I'll Be Back.
Alright, here is a "regular" ternary form with integer matrix, $$ 3 x^2 + 3 y^2 + 5 z^2 - 4 yz + 2 zx + 2 xy, $$ symmetric matrix
$$ \left( \begin{array}{rrr} 3 & 1 & 1 \\ 1 & 3 & -2 \\ 1 & -2 & 5 \end{array} \right) $$ The characteristic polynomial is irreducible, $\lambda^3 - 11 \lambda^2 + 33 \lambda - 21,$ with approximate roots $0.867, 3.859, 6.273.$
Alright, Hermite assumes (here) that we are expecting rational numbers all around: $f(x,y,z) = 3 x^2 + 3 y^2 + 5 z^2 - 4 yz + 2 zx + 2 xy. $ We begin with $3 (x + a y + b z)^2$ to wipe out the top row and left column of the matrix; here, $$ 3 \left(x + \frac{y}{3} + \frac{z}{3} \right)^2 = 3 \left( x^2 + \frac{y^2}{9} + \frac{z^2}{9} + \frac{2yz}{9} + \frac{2zx}{3} + \frac{2xy}{3} \right) , $$ $$ 3 \left(x + \frac{y}{3} + \frac{z}{3} \right)^2 = 3 x^2 + \frac{y^2}{3} + \frac{z^2}{3} + \frac{2yz}{3} + 2zx + 2xy. $$
Progress so far: $$ f(x,y,z) - 3 \left(x + \frac{y}{3} + \frac{z}{3} \right)^2 = \frac{8y^2}{3} + \frac{14 z^2}{3} + \frac{-14yz}{3} $$
Next, $$ \frac{8}{3} \left( y - \frac{7z}{8} \right)^2 = \frac{8}{3} y^2 - \frac{14}{3}y z + \frac{49}{24} z^2, $$ so $$ f(x,y,z) - 3 \left(x + \frac{y}{3} + \frac{z}{3} \right)^2 - \frac{8}{3} \left( y - \frac{7z}{8} \right)^2 = \frac{21z^2}{8} $$ and $$ f(x,y,z) = 3 \left(x + \frac{y}{3} + \frac{z}{3} \right)^2 + \frac{8}{3} \left( y - \frac{7z}{8} \right)^2 + \frac{21}{8} z^2 $$
The direction I just finished, expressed in matrices, says $$ \left( \begin{array}{rrr} 1 & 0 & 0 \\ 1/3 & 1 & 0 \\ 1/3 & -7/8 & 1 \end{array} \right) \left( \begin{array}{rrr} 3 & 0 & 0 \\ 0 & 8/3 & 0 \\ 0 & 0 & 21/8 \end{array} \right) \left( \begin{array}{rrr} 1 & 1/3 & 1/3 \\ 0 & 1 & -7/8 \\ 0 & 0 & 1 \end{array} \right) = \left( \begin{array}{rrr} 3 & 1 & 1 \\ 1 & 3 & -2 \\ 1 & -2 & 5 \end{array} \right) $$
The way I did it, which may appear clumsy, makes my matrix $P$ upper triangular with all $1$'s on the diagonal, so inverting is quick:
$$ \left( \begin{array}{rrr} 1 & 0 & 0 \\ -1/3 & 1 & 0 \\ -5/8 & 7/8 & 1 \end{array} \right) \left( \begin{array}{rrr} 3 & 1 & 1 \\ 1 & 3 & -2 \\ 1 & -2 & 5 \end{array} \right) \left( \begin{array}{rrr} 1 & -1/3 & -5/8 \\ 0 & 1 & 7/8 \\ 0 & 0 & 1 \end{array} \right) = \left( \begin{array}{rrr} 3 & 0 & 0 \\ 0 & 8/3 & 0 \\ 0 & 0 & 21/8 \end{array} \right) $$
You can think of a matrix $A$ as either a linear operator ($x \mapsto Ax$) or a bilinear form ($x,y \mapsto <x,Ay>$). Diagonalizing it using $PAP^{-1}$ diagonalizes the linear operator $A$, i.e. changes the basis of the vector space to one in which the linear operator is diagonal, whereas diagonalizing it using $PAP^{T}$ diagonalizes the bilinear form, i.e. changes the basis of the vector space to one in which the bilinear form is diagonal.