The purpose of this paper is to solve two types of Lyapunov equations and quadratic matrix equations by using the spectral representation. We focus on solving Lyapunov equations $AX+XA^*=C$ and $AX+XA^{T}=-bb^{T}$ for $A, X in mathbb{C}^{n times n}$ and $b in mathbb{C} ^{n times s}$ with $s < n$, which $X$ is unknown matrix. Also, we suggest the new method for solving quadratic matri...