Question: why Maple can't find simple answer to int( tan(x)^(n-2)*sec(x)^2,x)?

I had to use integration by parts to get the answer I need, but I do not think it is really needed for this. compare the output from:

r:=int(tan(x)^(n-2)*sec(x)^2,x);

(which is pages of very complicated output), with this:

r:=Int(tan(x)^(n-2)*sec(x)^2,x):
simplify(value(IntegrationTools:-Parts(r,tan(x))));

Does one really have to tell Maple to do integration by parts for this? I would have expected int() to do it as is.

Please compare to Mathematica:

Maple 18.02

added

The reason I think this should have been done by int() directly is that it is direct  application of the power rule of integration. I can't write Latex here, so I wrote it on my computer, and I copy the screen shot to explain for those interested:

Maple is so good in differential equations, but does not seem to be as good as it should when it comes to integration.

Please Wait...