Notice that x is assumed real which means that the result should not not have any imaginary terms but it does. What is going on here? And what is the best way to get rid of these terms?
Agreed. But the series is done with the assumption that x is real and under this assumption the imaginary part is zero. But what Mathematica shows is a non-zero imaginary part. This should not be.