In this video we will learn what is spectral decomposition of a matrix especially symmetric matrix. We will also discuss one example based on this. What do we mean by spectral decomposition? We know that the matrix A is said to be diagonalizable if there exist an linearly independent eigenvectors for that matrix. The matrix that is diagonalizable is also called eigen decomposition of that matrix. Here, we will study what is spectral decomposition. Let A be an n cross n real symmetric matrix. Now for a symmetric matrix, symmetric matrix means what? Symmetric matrix means A equal to A transpose. A symmetric matrix is always diagonalizable or we can say that eigen decomposition of a symmetric matrix is always guaranteed. If a symmetric matrix is diagonalizable, that means there will exist an invertible matrix P such that the symmetric matrix A can be expressed as PDP inverse. That means symmetric matrix of order n cross n there will always exist an linearly independent eigenvectors. Suppose Lambda 1, Lambda 2 up to Lambda n be the eigenvalues and corresponding eigenvectors are u_1, u_2 up to u_n. Then how we can write A in this form? Then this P can be written as u_1 you write as a column vector here, u_2 as a column vector here, which is the eigenvector corresponding to Lambda 1, eigenvector corresponding to Lambda 2, and similarly, eigenvector corresponding to Lambda n. This D is a diagonal matrix which is consisting of the eigenvalues of A. This is basically this P inverse. Now for a symmetric matrix A, the matrix P which we have just talked about, that matrix P is an orthogonal matrix. What is an orthogonal matrix? Orthogonal matrix means P into P transpose is identity. For a symmetric matrix we already have discussed one result that is four distinct eigenvalues. Eigenvectors are orthogonal. Hence, we can see that our constructed matrix P in this form is an orthogonal matrix. This P inverse in the previous expression which is A equal to PDP inverse. This P inverse will be replaced by P transpose. Hence this A can now be written as u_1 as a column vector, u_2 as a column vector, u_n as a column vector. This is a diagonal matrix consisting of the eigenvalues of A. This is basically P transpose. Therefore, the matrix A can now be written as. You can easily see that this is your P, this is your D, this is your P transpose. When you expand this for corresponding Lambda 1, this will be Lambda 1, u_1 into u_1 transpose. Similarly, Lambda 2 u_2 into u_2 transpose, and similarly, others. This A matrix can be written as Lambda 1, u_1 into u_1 transpose, Lambda 2, u_2 into u_2 transpose and so on, Lambda n, u_n into u_n transpose. This decomposition of a matrix, writing a matrix in this form is called a spectral decomposition of matrix A. Now, each vector u_i u_i transpose here, this like u_1 u_1 transpose, u_2 u_2 transpose, u_n u_n transpose. This is the projection onto one dimensional subspace spanned by u_i. Let us discuss one example based on this, at how we can decompose a matrix into a spectral form. Suppose a matrix of order 2 cross 2 is known to us and it's a symmetric matrix. How we can write this matrix into a spectral decomposition form? For that, first of all, we have to find out the eigenvalues and the corresponding eigenvectors. How to find eigenvalues? We write the characteristic polynomial in this form, A minus Lambda I determinant should be equal to zero. This implies determinant of 1 minus Lambda minus 2 minus 2, 1 minus Lambda equal to zero which further implies 1 minus Lambda, all this squared, minus 4 equal to 0. Or 1 minus Lambda is equal to plus or minus 2. This implies 1 minus Lambda is either two or 1 minus Lambda is minus 2, or Lambda is equal to minus 1 from here, or from here it is three. The eigenvalues for this matrix A are minus 1 and 3. Now, let us compute the eigenvectors corresponding to Lambda equal to minus 1 and 3. Eigenvector corresponding to Lambda equal to minus 1. It is A minus Lambda i x equal to zero which implies, you substitute Lambda equal to minus 1 here, it is A plus i times x equal to 0, or it will be 2 minus 2 minus 2, 2 times x means x_1, x_2, and this is 0, 0, which further implies x_1 equal to x_2. That means eigenvector corresponding to Lambda equal to minus 1 will be x_1, x_2. That is basically x_1, x_1. Because x_1 equal to x_2, so it is x_1 times 1, 1. The linearly independent eigenvector corresponding to Lambda equal to minus 1 is 1, 1. Now, to form an orthogonal matrix, divide each vector. Whatever eigenvector we obtained, divide that eigenvector by it's nor. Nor means simply length of the eigenvector. See you can see that, here it is under root 1 squared plus 1 squared which is under root 2. Divide component of this vector by under root 2. That will be 1 by under root 2 and 1 by under root 2. It is also the eigenvector corresponding to Lambda equal to minus 1. Because any scalar multiplication of 1, 1 will be the eigenvector corresponding to Lambda equal to minus 1. Now, for Lambda equal to 3, what is our matrix? Matrix is 1 minus 2 minus 2, 1. A minus 3 I X equal to 0. This implies minus 2, minus 2, minus 2, minus 2. That is x_1, x_2 equal to 0. This implies x_1 equal to minus x_2. The eigenvector corresponding to this will be 1 minus 1. The linearly independent eigenvector corresponding to Lambda equal to 3. Or we can write 1 by under root 2 minus 1 by under root 2 by dividing by its length. Now, how to find P. P as we've already seen, this P will be u_1 as a column vector here and u_2 as a column vector here. U_1 is an eigenvector corresponding to the first eigenvalue which is minus 1, and u_2 is an eigenvector corresponding to a second eigenvalue which is 3 here. It is what? One by under root 2 and it is 1 by under root 2. It is 1 by under root 2 and minus 1 by under root 2. One can easily verify that this matrix is an orthogonal matrix because here P into P transpose comes out to be an identity matrix. The matrix A can be written as PDP transpose. Now the spectral decomposition of this matrix will be what? The matrix A can be written as Lambda 1, u_1 u_1 transpose plus Lambda 2, u_2 u_2 transpose for a spectral decomposition. What is Lambda 1? Lambda 1 is minus 1. What is u_1? U_1 is 1 by under root 2, 1 by under root 2. What is u_1 transpose? One by under root 2, 1 by under root 2. Plus, what is Lambda 2? Lambda 2 is 3. What is u_2? U_2 we have obtained, this is your u_2. U_2 is 1 by under root 2 minus 1 by under root 2. Here it is, 1 by under root 2, minus 1 by under root 2. When you simplify it you will obtain. Finally, this will be equal to minus 1 by 2. One by and root can be taken common from here and here, so it will be 1 by 2. The matrix which is obtained as 1, 1, 1, 1. Plus, from this component, this will be 3 by 2 times 1, minus 1, minus 1, 1. This will be basically the spectral decomposition of the given matrix A. In this video we have seen that a symmetric matrix is always diagonalizable. Since it is always diagonalizable it can be expressed as a spectral decomposition. We have also discussed one example based on this.