# what's the problem with the following code? [closed]

I want to write an equation like the following:

What's the problem with the following code?

\begin{array}{lll}
U_2(\phi)=\begin{bmatrix}
\cos\phi & -\sin\phi \\ \sin\phi \cos\phi
\end{bmatrix}
& \Rightarrow
& U_{3T}(2\phi)=\begin{bmatrix}
1 & 0 & 0 \\ 0 & \cos 2\phi & \sin 2\phi \\ 0 & -\sin\2\phi & \cos 2\phi
\end{bmatrix}
\\
U_2(\tau)=\begin{bmatrix}
\cos\tau & j\sin\tau \\ j\sin\tau & \cos\tau
\end{bmatrix}
& \Rightarrow
& U_{3T}(2\tau)=\begin{bmatrix}
\cos 2\tau & 0 & j\sin 2\tau \\ 0 & 1 & 0 \\ j\sin 2\tau & 0 & \cos 2\tau
\end{bmatrix}
\\
U_2(\alpha)=\begin{bmatrix}
e^{+j\alpha} & 0 \\ 0 & e^{-j\alpha}
\end{bmatrix}
& \Rightarrow
& U_{3T}(2\alpha)=\begin{bmatrix}
\cos 2\alpha & j\sin 2\alpha & 0 \\ j\sin 2\alpha & \cos 2\alpha & 0 \\ 0 & 0 & 1
\end{bmatrix}
\end{array}


I'm getting the following error at line 7:

Error:

Undefined control sequence. ... & \cos 2\phi & \sin 2\phi \ 0 & -\sin\2

at line:

1 & 0 & 0 \ 0 & \cos 2\phi & \sin 2\phi \ 0 & -\sin\2\phi & \cos 2\phi

• You have escaped a 2: instead of \sin 2 you wrote \sin\2 (see the end of the line Undefined control sequence ...) – Astrinus Dec 16 '16 at 12:39
• @Astrinus you're right. The problem is solved now. I don't know whether to keep the question or delete it cuz I don't know if such questions that are related to typos and the OP's recklessness are allowed on site or not? – Sepideh Abadpour Dec 16 '16 at 12:44
• I'm voting to close this question as off-topic because the problem was caused by a typing error, identified in the comments. – barbara beeton Dec 16 '16 at 13:23

It seems \2 could be the problem. I can reproduce your error. If I take out the \2, it runs.
maybe you meant \,2 (an extra space) before the 2? or _2