I am having trouble with a trig identity problem. The book I am working out of provides step by step solutions and we are in agreement up to this point

[1 + 2Cos(x) - Sin^{2}(x) + Cos^{2}(x)] / 2Sin(x)Cos(x)

Here is where I went from there...

I turned the Sin^{2}(x) + Cos^{2}(x) into 1 in order to get

2Cos(x) / 2Sin(x)Cos(x)

I then cancelled to get a final result of

1/Sin(x) or CSC(x)

Here is what the book did...

the book substituted 1-Cos^{2}(x) in for Sin^{2}(x) in order to get

[2Cos(x) + 2Cos^{2}(x)] / 2Sin(x)Cos(x)

They then factored a 2Cos(x) out of the numerator and cancelled to get a final result of

[1 + Cos(x)] / Sin(x)

I understand why the book's method makes sense and works. What I can't figure out is why my way doesn't. If for example I substitute 17 in for x my method yields a result of 3.42 while their method results in 6.69. I'd appreciate any help or insight into what mistakes I'm making. If by some random chance someone reading this has the same book, I'm using Trigonometry Workbook for Dummies and working on problem 18 in chapter 11