Find an orthogonal matrix P and a diagonal matrix D such that
A = PDP^(-1).
I found P but how do I find D? Is it correct to do D = PAP^(-1)? Thanks in advance.
Do you know how to find a matrix P such that $\displaystyle P^{-1}AP = D $?
If your familiar with that all you need to do is some basic matrix algebra
first pre multiply both sides by P , $\displaystyle PP^{-1}AP = PD \ \ \Rightarrow IAP = PD $
then post multiply by $\displaystyle P^{-1}$ so $\displaystyle IAPP^{-1} = PDP^{-1} $
so $\displaystyle IAI = PDP^{-1} $
given $\displaystyle A = PDP^{-1} $
Bobak
Although you could do $\displaystyle D = P^{-1}AP$, there is a much easier way:
In the process of finding $\displaystyle P$, you probably found the eigenvalues and eigenvectors of $\displaystyle A$. We know that if the eigenvalues of $\displaystyle A$ are $\displaystyle \lambda_1,\;\lambda_2,\;\dots,\;\lambda_n$, and each eigenvalue $\displaystyle \lambda_i$ corresponds to an eigenvector $\displaystyle \textbf{p}_i$ such that $\displaystyle \textbf{p}_1,\;\textbf{p}_2,\;\dots,\;\textbf{p}_n$ are linearly independent, then the matrix $\displaystyle P = \left[\begin{array}{c|c|c|c}\textbf{p}_1 & \textbf{p}_2 & \cdots & \textbf{p}_n\end{array}\right]$ will diagonalize $\displaystyle A$, and $\displaystyle A = PDP^{-1}$. Now, it turns out that
$\displaystyle D = \left[\begin{matrix}
\lambda_1 & 0 & 0 & \cdots & 0\\
0 & \lambda_2 & 0 & \cdots & 0\\
0 & 0 & \lambda_3 & \cdots & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
0 & 0 & 0 & \cdots & \lambda_n
\end{matrix}\right]$
Therefore, if you diagonalized $\displaystyle A$ with $\displaystyle P$ to get $\displaystyle A = PDP^{-1}$, then $\displaystyle D$ will be a diagonal matrix whose diagonal entries are the eigenvalues of $\displaystyle A$, listed in the same order as you placed the eigenvectors of $\displaystyle A$ into $\displaystyle P$.
Let me give a brief example:
Let $\displaystyle A = \left[\begin{matrix}
1 & -1 & -1 \\
1 & 3 & 1 \\
-3 & 1 & -1
\end{matrix}\right]$
We may easily determine the eigenvalues of $\displaystyle A$ to be $\displaystyle \lambda_1 = 2,\;\lambda_2 = -2,\;\lambda_3 = 3$, and their corresponding eigenvectors:
$\displaystyle \begin{array}{lcrl}
\lambda_1 & = & 2: & \left[\begin{matrix}-1\\0\\1\end{matrix}\right]\medskip\\
\lambda_2 & = & -2: & \left[\begin{matrix}1\\-1\\4\end{matrix}\right]\medskip\\
\lambda_3 & = & 3: & \left[\begin{matrix}-1\\1\\1\end{matrix}\right]
\end{array}$
Putting these eigenvectors into the columns of $\displaystyle P$, we get
$\displaystyle P = \left[\begin{matrix}
-1 & 1 & -1\\
0 &-1 & 1\\
1 & 4 & 1
\end{matrix}\right]$
so $\displaystyle A = PDP^{-1}$ for some diagonal $\displaystyle D$. And if you find $\displaystyle D$, you will find that it is
$\displaystyle D = \left[\begin{matrix}
2 & 0 & 0\\
0 &-2 & 0\\
0 & 0 & 3
\end{matrix}\right]$
(try verifying this) and the entries along the main diagonal correspond exactly to the eigenvalues we found for $\displaystyle A$.
But, if you were to change the order of the eigenvectors in $\displaystyle P$, the entries in $\displaystyle D$ will also be in different order.
For example, if we had set
$\displaystyle P = \left[\begin{matrix}
1 & -1 & -1\\
-1 & 0 & 1\\
4 & 1 & 1
\end{matrix}\right]$,
then we would get
$\displaystyle D = \left[\begin{matrix}
-2 & 0 & 0\\
0 & 2 & 0\\
0 & 0 & 3
\end{matrix}\right]$