# Applying row operations to a matrix in order to get a diagonal matrix

Is there any way to obtain a diagonal matrix $D$ from a square matrix $A$ applying only row operations $R_{ij}(k)$ with $i\neq j$, $k\in\mathbb R$, which means add to the $i$-th row the $j$-th row multiplied by $k$. For example, if $$A = \begin{pmatrix}a&b\\c&d\end{pmatrix},\quad P = \begin{pmatrix}-\frac{\lambda d}{b} & \lambda \\ -\frac{\mu c}{a} & \mu\end{pmatrix} \quad (\lambda,\mu\in\mathbb R)$$ $P A = \begin{pmatrix} * & 0 \\ 0 & * \end{pmatrix}$, but how can $P$ be expressed as product of elementary matrices of that type? Thanks in advance.

-
Have you tried looking at $\begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}$? –  Michael Joyce Jan 24 '13 at 19:52

You can't always, e.g. there's no way to get a diagonal matrix from $$\pmatrix{1 & 1\cr 0 & 0\cr}$$ by these operations. But if you don't run into any inconvenient zeros, it is possible. First add appropriate multiples of row $1$ to each other row to make all $a_{i1} = 0$ for $i \ne 1$. Then add appropriate multiples of row $2$ to each other row to make $a_{i2} = 0$ for $i \ne 2$. Continue...
No. take $$A=\left[\begin{array}{cc}0&1\\-1&0\end{array}\right]$$ the operation on rows is the same ha multiplication by
$$L_1=\left[\begin{array}{cc}1&0\\x&1\end{array}\right]\;\;and\;\;L_2=\left[\begin{array}{cc}1&y\\0&1\end{array}\right].$$
but $L_1L_2A=\left[\begin{array}{cc}-y&1+x+xy\\-1&1+x\end{array}\right]$ can not be diagonal for any $x$ and $y$
But $\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ -1 & 1 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}$! –  Michael Joyce Jan 24 '13 at 20:34