Bug introduced in 7.0.1 or earlier, persists through 10.1
Consider the following integral:
Integrate[Log[a Cos[x]^2 + b Sin[x]^2], {x, 0, 2Pi}]
This takes a LONG time (this is Mathematica 10.0.1 on a Mac), and sometimes crashes the kernel, and sometimes returns:
$$ \frac{\left(4 i \pi \sqrt{\frac{a}{b}-1} \sqrt{-\frac{b}{a}} \sqrt{a b}+a \sqrt{-\frac{b}{a}} \sqrt{1-\frac{b}{a}} \log \left(-\frac{2 \left(\sqrt{a b}+b\right)}{a-b}\right)-a \log (2) \sqrt{-\frac{b}{a-b}}+\sqrt{-\frac{b}{a-b}} (b-a) \log \left(\frac{\sqrt{a b}-b}{a-b}\right)+b \log (2) \sqrt{\frac{b}{b-a}}\right) \sin ^{-1}\left(\frac{\sqrt{b}}{\sqrt{b-a}}\right)+\sqrt{b} \sqrt{b-a} \left(\left(\log \left(-\frac{\sqrt{a b}+b}{a-b}\right)-\log \left(\frac{\sqrt{a b}-b}{a-b}\right)\right) \sin ^{-1}\left(\sqrt{-\frac{b}{a-b}}\right)+2 \pi \left(-\log \left(\frac{\sqrt{a b}-b}{a-b}\right)-\log \left(-\frac{\sqrt{a b}+b}{a-b}\right)+\log (b)+2 i \pi -\log (4)\right)\right)}{\sqrt{b} \sqrt{b-a}} $$
Which is clearly wrong for, e.g., $a=2, b=3.$ (by the way, doing the integral with $2$ in place of $a$ and $3$ in place of $b$ does return the correct answer, albeit after much thought). On the other hand, the obviously equivalent:
Integrate[Log[1+a Cos[x]^2], {x, 0, 2Pi}]
returns relatively quickly with a seemingly correct answer.
The question is whether this is a new (10.0.1) bug, or a perma-bug? I don't have access to older mathematicae to check.