I want to show that $A\in O(2) \setminus SO(2)$ and $B \in SO(2)$ don't commute. To prove it I wrote
$$ B = \left ( \begin{array}{cc} \cos \theta & \sin \theta \\ - \sin \theta & \cos \theta \end{array} \right ) \in SO(2)$$
and
$$ A = \left ( \begin{array}{cc} \cos \phi & \sin \phi \\ \sin \phi & - \cos \phi \end{array} \right ) \in O(2) \setminus SO(2)$$
Then I calculated the products:
$$ AB = \left ( \begin{array}{cc} \cos (\phi + \theta) & \sin (\phi + \theta) \\ \sin (\phi + \theta ) & - \cos (\phi + \theta) \end{array} \right ) $$
and
$$ BA = \left ( \begin{array}{cc} \cos (\phi + \theta) & \sin (\phi - \theta) \\ \sin (\phi - \theta ) & - \cos (\phi + \theta) \end{array} \right ) $$
These are equal if and only if $\sin (\phi + \theta) = \sin (\phi - \theta)$ or equivalently, $\sin ( -\theta - \phi) = \sin (\theta-\phi)$.
I am now stuck arguing that, if $\theta$ is not a multiple of $\pi$, then this equation is never satisfied.
Please, how do I go about this?
Edit
I'm getting abit confused. I used the identity suggested in the answer by ajd and this is an exercise I'm doing in a book and it requests me to show that this $B$ does not commute for any such $A$ but now with the identity I calculated that for $\phi = {\pi \over 2}$ the matrices do actually commute. What is going on here? Is the exercise wrong?
There are two issues with your work. First, some $B\in SO(2)$ does commute with all $A\in O(2)\setminus SO(2)$: you know that $\pm I\in SO(2)$, don't you?
What is correct is that if $A\in O(2)\setminus SO(2),\ B\in SO(2)$ and $B\ne\pm I$, then $A,B$ do not commute.
Second, there are mistakes in your calculation. The two diagonal entries of $BA$ should be $\cos(\phi-\theta)$ and $-\cos(\phi-\theta)$, not $\cos(\phi+\theta)$ and $-\cos(\phi+\theta)$. Remember that for each matrix in $O(2)\setminus SO(2)$ or $SO(2)$, the arguments to the four trigonometric functions in its entries are the same angle.
To proceed with your work, see ajd's answer.