# Similarity transformation into symmetric matrix

I have a matrix of the form: $$\begin{bmatrix} 0 & q & 0 & 0 & 0 & 0 & \cdots \\ p & 0 & q & 0 & 0 & 0 & \cdots \\ 0 & p & 0 & q & 0 & 0 & \cdots \\ 0 & 0 & p & 0 & q & 0 & \cdots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \ddots \end{bmatrix}$$ Now, does there exist a similarity transformation that turns this into a symmetric matrx. If yes then how to find it.

• What have you tried? – Monadologie Aug 18 at 8:55

This obviously isn't always possible. E.g. if the underlying field is real, $$p=0$$ and $$q=1$$, we have a non-zero nilpotent matrix that cannot possibly be similar to any real symmetric matrix.

However, if $$p$$ and $$q$$ are non-zero, $$\frac pq=r^2$$ for some scalar $$r$$ in the underlying field and $$D=\operatorname{diag}(1,r,r^2,\ldots,r^{n-1})$$, then $$D^{-1}AD=\pmatrix{0&s\\ s&0&s\\ &s&\ddots&\ddots\\ &&\ddots&0&s\\ &&&s&0}$$ where $$A$$ is your matrix and $$s=qr=\frac{p}{r}$$.

• [+1] very short solution ! – Jean Marie Aug 19 at 7:51
• Another example where this transformation $M \to D^{-1}MD$ is used with the same matrix $D$ : math.stackexchange.com/q/2817767 – Jean Marie Aug 19 at 16:17

Let $$r=\sqrt{pq}$$ (we assume sign$$(p)$$=sign$$(q)$$).

The given tridiagonal matrix $$A$$ is similar to

$$B:=\begin{bmatrix} 0 & r & 0 & 0 & 0 & 0 & \cdots \\ r & 0 & r & 0 & 0 & 0 & \cdots \\ 0 & r & 0 & r & 0 & 0 & \cdots \\ 0 & 0 & r & 0 & r & 0 & \cdots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \ddots \end{bmatrix}$$

Why that ?

Let $$P_n=\det(A-\lambda I_n)$$, resp. $$Q_n=\det(B-\lambda I_n)$$ be the characteristic polynomial of $$A$$, resp. $$B$$.

Expanding the first determinant along its first column gives the recurrence relationship :

$$P_n=-\lambda P_{n-1}-pq P_{n-2} \ \ \text{with} \ \ P_1=-\lambda \ \ \text{and} \ \ P_2=\lambda^2-pq \tag{1}$$

(this is a classical way to compute the characteristic polynomial of a tridiagonal matrix).

Doing a similar expansion for the second determinant, one obtains the same relationship as (1). Therefore $$A$$ and $$B$$ have the same determinant.

As a symmetric matrix is diagonalisable, one can write : $$D=P^{-1}AP$$ and $$D=Q^{-1}BQ$$ with the same diagonal matrix $$D$$ (diagonal entries being the common eigenvalues).

From $$P^{-1}AP=Q^{-1}BQ$$, one deduces

$$A=(QP^{-1})^{-1}B(QP^{-1})$$

Thus $$A$$ and $$B$$ are similar.

Important remark : In the case $$r = 1$$, the characteristic polynomial of $$B$$ is easily shown to be $$U_n(-2x)$$ where $$U_n$$ is the n-th Chebyshev polynomial of the second kind (see https://en.wikipedia.org/wiki/Chebyshev_polynomials) ; as a consequence, in the odd case $$n=2m+1$$ ; the eigenvalues of $$A$$ and $$B$$ are $$2 \sqrt{pq} \sin(k \pi/(n+1))$$ for $$k=-m...m$$.

• $P_n=Q_n$ doesn't imply that $A$ and $B$ are similar. Take $$A=\begin{bmatrix}1&0\\0&1\end{bmatrix}$$and $$B=\begin{bmatrix}1&1\\0&1\end{bmatrix}$$ – Mostafa Ayaz Aug 18 at 9:49
• @MostafaAyaz Actually you are true, similarity of characteristic polynomials does not suffice similarity of two. I was being ignorant. – user539586 Aug 18 at 10:08
• It is OK. I explained it in my own answer. Hope it help! – Mostafa Ayaz Aug 18 at 10:09
• Following the remark of @Mostafa Ayaz, I have modified my answer. – Jean Marie Aug 18 at 10:12
• See added remark. – Jean Marie Aug 18 at 12:32