That's the answer I got for the second one too, but the book had a different one. Actually, the answer comes to the same thing it's just written differently.
Which one am I meant to do in a test?
If the question asks you to factorise something full marks will be given
for as complete a factorisation as possible under the constraints you
are expected to observe (probably factors with real coefficients).