Question: Why does Maple give inconsistent results when computing the integral of tan(x)?

If I let Maple computer the integral of tan(x), it gets

Int(tan(x), x)=int(tan(x),x), which is the same result as many other softwares get.

However, if I do integral of tan(2*x), it becomes

Int(tan(2*x), x)=(1/4)*ln(1+tan(2*x)^2), instead of -(1/2)*ln(cos(2*x)). The latter form should make more sense considering what Maple gives for tan(x).

In fact, Maple alwys gives the anwer ln(1+tan(n*x)^2)/(2*n) (1) as the integral for tan(n*x) when n>=2. While this is also an indefinite integral of tan(n*x), it is not exactly the equivalent of -(1/n)*ln(cos(n*x)) (2), which is the form Maple gives for integral of tan(x). Expression (2) sometimes evaluates to complex values while (1) only evaluates to real values. It seems that for integral of tan(2x) Maple tries to find the antiderivative that always evaluates to real values, but for tan(x) Maple is happy with -ln(cos(x)), whose value may be complex.

Is there a reason why Maple does this? And is there any way to change the way Maple computes indefinite integrals?

Please Wait...