Below I'm showing all the steps (which they don't in my book) to show you the whole process so you can let me know where I went wrong. In my book they go from Line 1 to line 5 and then line 7 (which is the line I get wrong). I guess I must be doing something wrong in line 6 then? Please help. $$\begin{align} L\{\cos{at}\}&= \frac{1}{2}\left(\frac{1}{s-ia}+\frac{1}{s+ia}\right)\\ &=\frac{1}{2}\left(\frac{s+ia}{s+ia}\cdot\frac{1}{s-ia}+\frac{s-ia}{s-ia}\cdot\frac{1}{s+ia}\right)\\ &=\frac{1}{2}\left(\frac{s+ia}{s^2-sia+sia-i^2a^2}+\frac{s-ia}{s^2+sia-sia-i^2a^2}\right)\\ &=\frac{1}{2}\left(\frac{s+ia}{s^2-i^2a^2}+\frac{s-ia}{s^2-i^2a^2}\right)\\ &=\frac{1}{2}\left(\frac{s+ia+s-ia}{s^2-i^2a^2}\right)\\ &=\frac{1}{2}\left(\frac{2s}{s^2-i^2a^2}\right)\\ &=\frac{s}{s^2-i^2a^2} &s>0 \end{align}$$
however, in my book the final answer is: $$\frac{s}{s^2+a^2}$$
What am I doing wrong?
Everything you have done is correct. The only thing you need to do is to recall that $i^2=-1$.