Hi all guys,

I had the following indefinite integral to solve:

[tex]\int\frac{a^{2}cos^{2}\left(x\right)}{1+a^{2}cos^{2}\left(x\right)}dx[/tex]

The result I found is (ask for the step-by-step I did):

[tex]\int\frac{a^{2}cos^{2}\left(x\right)}{1+a^{2}cos^{2}\left(x\right)}dx = x+\frac{\arctan\left(\frac{\tan^{-1}\left(x\right)}{\sqrt{a^{2}+1}}\right)}{\sqrt{a^{2}+1}}[/tex]

The wolfram alpha result is

[tex]\int\frac{a^{2}cos^{2}\left(x\right)}{1+a^{2}cos^{2}\left(x\right)}dx = x-\frac{\tan^{-1}\left(\sqrt{a^{2}+1}\tan\left(x\right)\right)}{\sqrt{a^{2}+1}}[/tex]

Which one is correct?

Thank you all for your help!