Both substitutions are correct, the book's substitution would have been easier though.

Your answer was

Although it really isn't intuitive, from there you can use the tangent identity to rewrite your integral as now -1/2 is a constant and any constant plus an arbitrary constant is still an arbitrary constant so your answer becomes

When all else fails, you can always try writing those trig functions in terms of sine and cosine. For this problem it would be

that's a lot more unnecessary work, but it's a surefire way to get an answer