Without knowing the domain you could potentially be dividing by 0 when cos(x)=0 if you cancel. It is better to take cos(x) from both sides and factor out cos(x)
Either or
This should give 3 principal solutions and there may be more or less depending on the domain (usually )