That last step used the substitution $$ x = r \cos \alpha \\\ y = r \sin \alpha $$ The whole equation seems to derive the $x$-coordinate of the vector $(r,0)^t$ rotated first by angle $\alpha$ then by $\beta$ around the $z$-axis, which is the same as rotating it by $\alpha + \beta$.