Find the subgroup of $GL(2,\mathbb{C})$ generated by two matrices $A$ and $B$. 
Find the subgroup of $GL(2,\mathbb{C})$ generated by the matrices $A$ and $B$, where $A=\begin{pmatrix}
1 & 0\\
0 & i
\end{pmatrix}$ and $B=\begin{pmatrix}
0 & 1\\
-1 & 0
\end{pmatrix}$.

I have tried some thing and I found that order of both $A$ and $B$ is 4.
 A: Here's a more structural approach. Let $G=\langle A,B\rangle$. As you already noted $A$ and $B$ have order $4$. Now note that $A^2 = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$.
Hence $P:=A^2B= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ is a permutation matrix. Clearly $G=\langle A,P\rangle$.
If $D$ is a diagonal matrix, then $PDP^{-1}$ is again a diagonal matrix with the diagonal entries flipped. Let $N$ be the subgroup of $G$ generated by $A$ and $PAP^{-1}$. Then $N$ consists of diagonal matrices with entries in $\{1,i,-1,-i\}$.
Note that $N \cong \mathbb Z/4 \mathbb Z \times \mathbb Z/4\mathbb Z$. $N$ contains $\langle A \rangle$ and is closed under conjugation by $P$. Since $G$ is generated by $A$ and $P$, this is sufficient to see that $N$ is a normal subgroup of $G$. Moreover, $\langle P \rangle \cap N$ is the trivial group. Hence $G$ is a semidirect product of $N$ and $\langle P \rangle \cong \mathbb Z/2\mathbb Z$. Explicitly,
$$
G \cong (\mathbb Z/4\mathbb Z \times \mathbb Z/4\mathbb Z) \rtimes \mathbb Z/2\mathbb Z,
$$
where $\mathbb Z/2\mathbb Z$ acts on $\mathbb Z/4\mathbb Z \times \mathbb Z/4\mathbb Z$ by flipping the components.
In particular $G$ has 32 elements, and every element can be uniquely written in the form $A^j (PAP^{-1})^k P^l$ with $j$, $k \in \{0,\ldots,3\}$ and $l \in \{0,1\}$.
A: Since $A^3=A^{-1}$ and $B^3=B^{-1}$, all the elements of the group generated by $A$ and $B$ take the form $ A^{a_1}B^{b_1}A^{a_2}B^{b_2}...$  
But then we notice that $BA$=$ABC$ where $C=\begin{pmatrix}
-i& 0\\
0 & i
\end{pmatrix}$
We notice also that $AC=CA$ and that $CB= - BC$. 
Because of this, we can rewrite $ A^{a_1}B^{b_1}A^{a_2}B^{b_2}... = (-1)^{k}A^{a}B^{b}C^{c} $
where 
$k$ is in $\{0,1\}$ , 
$a$ is in $\{0,1,2,3\}$ , 
$b$ is in $\{0,1,2,3\}$ , 
$c$ is in $\{0,1\}$  (for 2 and 3 aren't necessary because we can integrate them in $k$)
Now we now that all the elements of the group take the above form, so all we have to do is to show that we can get all these elements. 
But this is easy one we realize that we can identify $(-1)^{k}$ with $B^{2k}$ and $C=B^3A^3BA$. 
The group we're looking for is composed of the elements  
$(-1)^{k}A^{a}B^{b}C^{c} $
where 
$k$ is in $\{0,1\}$ , 
$a$ is in $\{0,1,2,3\}$ , 
$b$ is in $\{0,1,2,3\}$ , 
$c$ is in $\{0,1\}$ 
but as said earlier $B^{2k}= (-1)^k$ so we can forget about the $(-1)^k$ 
and where we replace C by it's value, we see that we remove other redundancies by absorbing the $B^3$ at the beginning of $C$ in the $B^b$  so we end up with elements of the form 
$A^{a}B^{b}A^{-c}B^{c}A^{c}$
where 
$a$ is in $\{0,1,2,3\}$ , 
$b$ is in $\{0,1,2,3\}$ , 
$c$ is in $\{0,1\}$ 
Note that there may be some redundancies. 
A: Let us study the following set of matrices
$$
G=\left\{\left(\begin{array}{cc}x_1&0\\0&x_2\end{array}\right)\mid x_1,x_2\in\mu_4 \right\}\cup
\left\{\left(\begin{array}{cc}0&x_1\\x_2&0\end{array}\right)\mid x_1,x_2\in\mu_4 \right\},
$$
where $\mu_4=\{\pm1,\pm i\}$ is the set of complex fourth roots of unity.
We first observe that the described set of 32 matrices is closed under multiplication, so $G$ is a subgroup of $GL_2(\Bbb{C})$. I claim that $G=\langle A, B\rangle$ is the group generated by $A$ and $B$. Clearly $A$ and $B$ both are elements of $G$, so $\langle A,B\rangle\le G$.
The subset of diagonal matrices (=the left half) is clearly a subgroup of $G$, call it $H$. A straightforward calculation shows that
$$
BAB^{-1}=\left(\begin{array}{cc}i&0\\0&1\end{array}\right).
$$
From this it follows immediately that $H$ is generated by $A$ and $BAB^{-1}$.
Therefore all of $H$ is contained in $\langle A,B\rangle$. Because $B\notin H$ we see that $\langle A,B\rangle$ has index less than two in $G$, so we get our claim.
The group $H$ is a direct product $C_4\times C_4$. Conjugation by the element
$$
C=\left(\begin{array}{cc}0&1\\1&0\end{array}\right)\in G
$$
of order two
is an automorphism of $H$ that interchanges the two $C_4$ coordinates. Therefore we can describe $G$ as a semi-direct product
$$
G\cong (C_4\times C_4)\rtimes C_2.
$$
Caveat: There are non-isomorphic semidirect products of these two groups because there are essentially different ways the group $C_2$ can act on the direct product.
