If $T$ is strictly upper triangular, can we find upper triangular $A,B \in M_n(\Bbb C)$ such that $T = AB- BA$? Consider $M_n(\Bbb C)$, the vector space of matrices taking entries from $\Bbb C$,  for $n \ge 2$. We know that the collection of upper triangular matrices in $M_n(\Bbb C)$ forms a subspace of $M_n(\Bbb C)$. Additionally, if we start with two upper triangular matrices $A,B \in M_n(\Bbb C)$, then the commutator $AB-BA$ is strictly upper triangular.
I believe the converse is true, i.e., given a strictly upper triangular matrix $T \in M_n(\Bbb C)$, we can find two upper triangular matrices $A,B \in M_n(\Bbb C)$ such that $T = AB - BA$.
I have thought of some examples (as follows) where this can be done, but I have not yet written a proof that takes care of all cases.

*

*If $T = 0$, then any two commuting matrices $A,B \in M_n(\Bbb C)$ will do. In fact, we can just pick $A,B$ to be any two diagonal matrices. This already tells us that the choice of $A,B$ need not be unique.


*One of the simpler cases to consider is $n = 2$. If $A_1 = \left(\begin{matrix} p_1 & q_1\\ 0 & r_1 \end{matrix}\right)$ and $A_2 = \left(\begin{matrix} p_2 & q_2\\ 0 & r_2 \end{matrix}\right)$, then
$$A_1A_2 - A_2A_1 = \left(\begin{matrix} 0 & p_1q_2 + q_1r_2-p_2q_1-q_2r_1\\ 0 & 0  \end{matrix}\right)$$
Given a strictly upper triangular matrix $T = \left(\begin{matrix} 0 & \lambda \\ 0 & 0 \end{matrix}\right)$, we need to solve
$$p_1q_2 + q_1r_2-p_2q_1-q_2r_1 = \lambda,$$
i.e., one equation in eight variables. This system is overdetermined, so we can pick values of $p_1, p_2, \ldots$, etc. that solve the equation. There are infinitely many solutions!
To repeat the same process for $M_n(\Bbb C)$ is cumbersome, and I'm hoping a proof by induction of some sort might do the trick. Thank you!
 A: The equation can be solved directly. Pick any diagonal matrix $A$ with distinct diagonal elements. The equation $T=AB-BA$ then reduces to $t_{ij}=(a_{ii}-a_{jj})b_{ij}$, which is solved by the strictly upper triangular matrix $B$ such that $b_{ij}=t_{ij}/(a_{ii}-a_{jj})$ when $i<j$.
A: Oliver Díaz beat me to it, but might as well finish writing this:
Let $\mathcal{P}(n)$ be the property: "For all $T \in M_n(\mathbb{C})$ strictly upper triangular, there exists $A \in M_n(\mathbb{C})$ invertible and $B \in M_n(\mathbb{C})$ both upper triangular such that $T = AB - BA$".

*

*$n = 2$ : with $T = \pmatrix{0 & \lambda \\ 0 & 0}$, it suffices to consider $A := \pmatrix{ 1 & 1 \\ 0 & r}$ and $B := \pmatrix{ 1 & 1 \\ 0 & \lambda + r}$ for any $r \neq 0$ (you can check this quite easily with the formula/equation provided in the question), thus $\mathcal{P}(2)$ is true.

*Suppose $\mathcal{P}(n)$ for a given $n \geq 2$. Let's show that $\mathcal{P}(n+1)$ is true.

Let $T \in M_{n+1}(\mathbb{C})$ be a strictly upper triangular matrix. $T$ can be written in the form
$$T =: \pmatrix{T' & C_T \\ 0_{1,n} & 0}$$ with $T' \in M_n(\mathbb{C})$ strictly upper triangular and $C_T \in M_{n,1}(\mathbb{C})$.
By $\mathcal{P}(n)$, there exists $A' \in M_n(\mathbb{C})$ invertible and $B' \in M_n(\mathbb{C})$ both upper triangular such that: $T' = A'B' - B'A'$.
Take any $\alpha \in \mathbb{C} \setminus(\operatorname{Sp}(A') \cup \{0\})$ (where $\operatorname{Sp}(M)$ designates the set comprised of the eigenvalues of $M$), which makes $A' - \alpha I_n$ still invertible. Let $C$ be the following matrix: $$C := (A' - \alpha I_n)^{-1}C_T$$
Finally, define the following matrices:
$$A := \pmatrix{A' & 0_{n,1} \\ 0_{1,n} & \alpha},\quad B := \pmatrix{B' & C \\ 0_{1,n} & 0}$$
$A$ and $B$ are both upper triangular of size $n + 1 \times n + 1$, and $A$ is invertible thanks to $A'$ being invertible and $\alpha$ being distinct from $0$.
We finally get:
$$AB - BA = \pmatrix{A'B' - B'A' & (A' - \alpha I_n)C \\ 0_{1,n} & 0} = \pmatrix{T' & C_T \\ 0_{1,n} & 0} = T$$ which proves $\mathcal{P}(n+1)$ true, and thus the result by induction.
A: Using block matrices will be useful in your induction argument. Any $p\times p$ strictly upper triangular matrix can be expressed as
$$T=\begin{pmatrix} T_{p-1} & u\\ \overline{0}_{1\times(p-1)}&0 \end{pmatrix}$$
where $T_{p-1}$ is a $(p-1)\times (p-1)$ strictly upper triangular matrix and $u$ is a $(p-1)$-vector. Suppose that $T_{p-1}=A_1B_1-B_1A_1$ where $A_1,B_1$ are $(p-1)\times(p-1)$ upper triangular matrices.  Are there any $p-1$-vectors $v_1, w_1$ and scalars $a_{pp}$ and $b_{pp}$ such that
\begin{align}
\begin{pmatrix} T_{p-1} & u\\ \overline{0}_{1\times(p-1)} & 0\end{pmatrix}&=
\begin{pmatrix}A_1 & v_1\\
\overline{0}_{1\times(p-1)}  & a_{pp}\end{pmatrix}\begin{pmatrix}B_1 & w_1\\
\overline{0}_{1\times(p-1)}  & b_{pp}\end{pmatrix} - \begin{pmatrix}B_1 & w_1\\
\overline{0}_{1\times(p-1)}  & b_{pp}\end{pmatrix}\begin{pmatrix}A_1 & v_1\\
\overline{0}_{1\times(p-1)}  & a_{pp}\end{pmatrix}\\
&=\begin{pmatrix}A_1B_1-B_1A_1 &A_1w_1-B_1v_1+v_1b_{pp}-w_1a_{pp}\\ \overline{0}_{1\times(p-1)} & 0
\end{pmatrix}\\
&=\begin{pmatrix} T_{p-1}  &A_1w_1-B_1v_1+v_1b_{pp}-w_1a_{pp}\\ \overline{0}_{1\times(p-1)} & 0
\end{pmatrix}
\end{align}
holds? that is,
is there a solution to the equation
$u=A_1w_1-B_1v_1 + v_1b_{pp}-w_1a_{pp}$?
The answer is yes, there is such a solution. If say $a_{pp}$ is not an eigenvalue of $A_1$, then $(A_1-a_{pp} I_{p-1})$ is invertible and the equation
$$(A_1-a_{pp}I_{p-1})w_1=u+(B_1-b_{pp}I_{p-1})v_1$$
has a unique solution $w_1$ for any given $b_{pp}$ and $v_1$.

*

*Notice that if $A_1$ is a $(p-1)\times (p-1)$ diagonal matrix, and $B_1$ is a $(p-1)\times(p-1)$ strictly upper triangular matrix, then by taking $v_1=\overline{0}_{(p-1)\times1}$ and $b_{pp}=0$ we obtain a diagonal matrix $A$  another strictly upper triangular matrix $B$ given by
\begin{align}
A=\begin{pmatrix} A_1 & \overline{0}_{(p-1)\times1}\\\overline{0}_{1\times(p-1)} & a_{pp}\end{pmatrix}, \qquad
B=\begin{pmatrix} B_1 & (A_1-a_{pp}I_{p-1})^{-1}u\\
\overline{0}_{1\times(p-1)} & 0\end{pmatrix}
\end{align}
such that $T=AB-BA$.


To check the induction argument works notice that
$$\begin{pmatrix} 1 & 0\\ 0 & -1\end{pmatrix}\begin{pmatrix} 0 & \lambda/2\\ 0 & 0\end{pmatrix}-\begin{pmatrix} 0 & \lambda/2\\ 0 &0\end{pmatrix}\begin{pmatrix} 1 & 0\\ 0 & -1\end{pmatrix}=\begin{pmatrix} 0 & \lambda/2\\ 0 & 0\end{pmatrix}-\begin{pmatrix} 0 & -\lambda/2\\ 0 & 0\end{pmatrix}=\begin{pmatrix} 0 & \lambda\\ 0 & 0\end{pmatrix}
$$
Hence, the decomposition of any $p\times p$ strictly upper triangular matrix , $p=2$, as a commutator of $2\times 2$ triangular matrices exists.

Thus, we have proved that

For any $p\times p$ strictly upper triangular $T$ there is a $p\times p$ diagonal matrix $A$ and a $p\times p$ strictly upper diagonal matrix $B$ such that $T=AB-BA$.


