Is it true that any matrix in $M_2(\mathbb R)$ is the sum of two squares?

Let $dI$ be the identity multiplied by a large positive number $d$.

Then $A+dI$ has a square root. So $A+dI=B^2$

But $-dI=\begin{bmatrix}0&-\sqrt{d}\\\sqrt{d}&0\end{bmatrix}^2$.

So, $$A=B^2+\begin{bmatrix}0&-\sqrt{d}\\\sqrt{d}&0\end{bmatrix}^2$$


Your statement is TRUE. To begin with, let us introduce some notations and prove some useful facts first. Given $\lambda\ge 0$ and $\theta\in \Bbb R$, define

$$R(\lambda,\theta):=\lambda\cdot\begin{pmatrix}\cos \theta & -\sin \theta\\ \sin \theta & \cos \theta\end{pmatrix}\in M_2(\Bbb R),$$ and note that $$R(\lambda,\theta)= \big(R(\sqrt{\lambda},\frac{\theta}{2})\big)^2.$$

Given $M=\begin{pmatrix}a & b\\ c & d\end{pmatrix}\in M_2(\Bbb R)$, denote $$\Delta(M):=({\rm tr}M )^2-4\cdot\det M=(a-d)^2+4bc, $$ which is the discriminant of the characteristic polynomial of $M$.


Lemma: Given $M\in M_2(\Bbb R)$, $\Delta(M)<0$ if and only if the exist $T\in GL_2(\Bbb R)$, $\lambda>0$ and $\theta\in (0,\pi)$, such that $$T^{-1}MT=R(\lambda,\theta).\tag{1}$$

Proof: $\Delta(M)< 0$ if and only if there exist $\lambda>0$ and $\theta\in(0,\pi)$, such that the two eigenvalues of $M$ are $\lambda e^{i\theta}$ and $\lambda e^{-i\theta}$, so the "if" part is obviously true. To prove the "only if" part, let $u+iv$ be an eigenvector of $M$ with eigenvalue $\lambda e^{-i\theta}$, where $u,v\in\Bbb R^2$. Then $u-iv$ is an eigenvector of $M$ with eigenvalue $\lambda e^{i\theta}$, so $u$ and $v$ are linearly independent. Moreover, $$M(u+iv)=\lambda e^{-i\theta}(u+iv)=\lambda\big((\cos \theta\cdot u+\sin \theta\cdot v)+i (-\sin \theta\cdot u +\cos \theta\cdot v)\big).$$ That is to say, $(1)$ holds for $T=(u,v)$. $\quad\square$


Corollary: If $\Delta(M)<0$, then there exists $N\in M_2(\Bbb R)$, such that $M=N^2$.

Proof: According to the lemma, $(1)$ holds for $M$. Then for $N=T\cdot R(\sqrt{\lambda} ,\frac{\theta}{2})\cdot T^{-1}\in M_2(\Bbb R)$, $M=N^2$. $\quad\square$


Now let us prove your statement. Given $\lambda>0$ and $M=\begin{pmatrix}a & b\\ c & d\end{pmatrix}\in M_2(\Bbb R)$, $$M_\lambda:=M+R(\lambda, \frac{\pi}{2})=\begin{pmatrix}a & b-\lambda\\ c+\lambda & d\end{pmatrix}\Longrightarrow \lim_{\lambda\to+\infty}\Delta(M_\lambda)=-\infty.$$ Then by the corollary, when $\lambda>0$ is large, $M_\lambda =N_\lambda ^2$ for some $N_\lambda \in M_2(\Bbb R)$. As a result, $$M= M_\lambda +R(\lambda, -\frac{\pi}{2})=N_\lambda ^2 + \big( R(\sqrt{\lambda},-\frac{\pi}{4})\big )^2,$$ which completes the proof.


Remark Added: In fact, it is not very hard to prove the following statement.

Proposition: Given $M\in M_2(\Bbb R)$, let $\lambda_1$ and $\lambda_2$ be the two eigenvalues(counting multiplicity) of $M$, and $\Re\lambda_1\ge \Re\lambda_2$, where $\Re z$ denotes the real part of $z\in\Bbb C$. Then there exists $N\in M_2(\Bbb R)$ such that $M=N^2$if and only if one of the following conditions holds:

  1. $\lambda_1>0$ and $\lambda_2\ge 0$, or equivalently, $\det M\ge 0$ and ${\rm tr }M >0$;
  2. $|\lambda_1|=|\lambda_2|:=\lambda$, and there are $T\in GL_2(\Bbb R)$ and $\theta\in [0,\pi]$ such that $T^{-1}MT=R(\lambda, \theta)$.

Then to prove your statement, it suffices to show that for every $M\in M_2(\Bbb R)$, there eixst $A, B\in M_2(\Bbb R)$, such that $M=A+B$ and for both $A$ and $B$, either case 1. or case 2. holds. In Jack's answer, it is shown that one of $A$ and $B$ can be chosen from case 1. and the other from case 2.; in my answer, it is shown that $A$ and $B$ can be chosen from case 2. simultaneously.