# Factoring out the $\tan(x)$ yields $\tan(x)(\sin(x)+1)$. I believe your confusion was from the lack of parentheses.