# Section 7.3 $\quad$ Diagonalization of Symmetric Matrices

In this section, we consider diagonalization of symmetric matrices since they are easier to handle and they arise in many applications.

## Two Properties of Symmetric Matrices

- All eigenvalues of a symmetric matrix are <br /><br />
- Eigenvectors belonging to distinct eigenvalues are <br /><br />

### Example 1

Find eigenvalues and eigenvectors of the matrix
\begin{equation*}
  A = \left[
        \begin{array}{rrr}
          0 & 0 & -2\\
          0 & -2 & 0\\
          -2& 0 & -3 \\
        \end{array}
      \right]
\end{equation*}


```python
from sympy import *

A = Matrix([[0, 0, -2], [0, -2, 0], [-2, 0, -3]]);

A.eigenvects()
```




    [(-4, 1, [Matrix([
       [1/2],
       [  0],
       [  1]])]), (-2, 1, [Matrix([
       [0],
       [1],
       [0]])]), (1, 1, [Matrix([
       [-2],
       [ 0],
       [ 1]])])]



## Orthogonal Matrix

Eigenvectors of a symmetric matrix is orthogonal; hence,<br /><br /><br /><br />

>**Definition** A real square matrix $A$ is called $\underline{\hspace{1.5in}}$, if <br /><br /><br /><br />

### Example 2

Let $A$ be the matrix defined in Example 1. Find an orthogonal matrix $P$ such that $D=P^{-1}AP$.


```python
from sympy import *

A = Matrix([[0, 0, -2], [0, -2, 0], [-2, 0, -3]]);
B = A.diagonalize()[0];

B.QRdecomposition()[0]
```




    Matrix([
    [  sqrt(5)/5, 0, -2*sqrt(5)/5],
    [          0, 1,            0],
    [2*sqrt(5)/5, 0,    sqrt(5)/5]])



## Several Results Involving Orthogonal Matrices

1. $A$ is orthogonal if and only if <br /><br />
- If $A$ is an orthogonal matrix, $det(A) = $<br /><br />
- If $A$ is a symmetric matrix,<br /><br />

### Example 3

Find an orthogonal matrix $P$ such that such that $D=P^{-1}AP$ where
\begin{equation*}
  A = \left[
        \begin{array}{rrr}
          0 & 2 & 2\\
          2 & 0 & 2\\
          2 & 2 & 0 \\
        \end{array}
      \right]
\end{equation*}


```python
from sympy import *

A = Matrix([[0, 2, 2], [2, 0, 2], [2, 2, 0]]);
B = A.diagonalize()[0];

B.QRdecomposition()[0]
```




    Matrix([
    [-sqrt(2)/2, -sqrt(6)/6, sqrt(3)/3],
    [ sqrt(2)/2, -sqrt(6)/6, sqrt(3)/3],
    [         0,  sqrt(6)/3, sqrt(3)/3]])



8b877f3cc03eae9551fdf7086a1a929caed7ed7c
ipynb
Jupyter Notebook
Jupyter_Notes/Lecture38_Sec7-3_DiagonalSymmMat.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture38_Sec7-3_DiagonalSymmMat.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture38_Sec7-3_DiagonalSymmMat.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Qwen/Qwen-72B
1. YES
2. YES