The solution would be like this for this specific problem:
(cos^2x-1)/cosx+1
cos^2x-1= (cosx+1)(cosx-1)
cosx-1
I am hoping that this answer has satisfied your query and it will be able to help you in your endeavor, and if you would like, feel free to ask another question.