Evidently, it's not a problem to obtain the correct result. But, Mma submit a strange result, especially for some users, e.g. school students.
It's interesting to see the full form of the expression:

In my opinion, the result have to be more rigorous, e.g. to highlight correct result for Reals and Complex numbers, separately.