Integral on a derivative's answer won't give original function

Integrate[D[ArcSin,x],x]

The answer is

ArcTan[x/Sqrt[1-x^2]]

Is this a bug?

Best way to check is to differentiate the integral, subtract the integrand, and see if the result is zero.

f = ArcSin;
D[Integrate[f, x], x] == f
(True)

Below is what I got

Try FullSimplify on that last expression

I think this thread is trying to hint at a couple of things:

  • Integration and differentiation are not perfect inverses of each other. The most obvious reason is that you can always tack on a constant term to the anti-derivative, but there are other considerations, like being able to effectively ignore isolated points of discontinuity. So, some care might need to be taken if you’re expecting the integral of the derivative to equal the original expression.
  • The expression ArcSin[x] is effectively equivalent to ArcTan[x/Sqrt[1 - x^2]], so in some sense you did get the original back.

For me works fine.

Regards M.I.

Yes, it is correct in math sense as ArcTan[x/Sqrt[1-x^2]] is the same as ArcSin[x]. However, it did caught me off guard when Integrate[D[ArcSin[x],x],x] did not give me ArcSin[x] directly.

To be precise, ArcTan[x/Sqrt[1-x^2]] is equivalent to ArcSin[x] when -1 < x < 1:

{ArcTan[x/Sqrt[1 - x^2]], ArcSin[x]} /. x -> 2.
ReImPlot[ArcTan[x/Sqrt[1 - x^2]] - ArcSin[x], {x, -5, 5}]

However, in both versions 12.0 and 13.2 from

Integrate[D[ArcSin[x], x], x]

I get ArcSin[x].