# Stokes theorem in Mathematica

I came across this problem in calculus. It makes a handwavy sense with the explanation provided. I have tried to prove it in MMA:

F[x_, y_] := ArcTan[x, y];
GradF[x_, y_] := {D[F[x, y], x], D[F[x, y], y]};
FPrime[r_, ϕ_] := (D[GradF[x, y][[2]], x] - D[GradF[x, y][[1]], y]) /. {x -> r Cos[ϕ], y -> r Sin[ϕ]};
I1[ϕ_] = Integrate[r  FPrime[r, ϕ], {r, 0, a}];
Integrate[I1[ϕ], {ϕ, 0, 2 π}]


And got zero! Is there a way to obtain the result in the link provided above through straightforward MMA calculation?

• You are getting zero because FPrime[x, y] // FullSimplify is equal to zero (hence its integrals are zero). – bill s Mar 25 '19 at 22:48
• @bill s No kidding! I know. In fact it is not supposed to be zero. It is supposed to be proportional to Dirac Delta... Please, read the response in the link I have provided. – MsTais Mar 26 '19 at 0:01
• "It is supposed to be proportional to Dirac Delta" - so, zero almost everywhere? Then, this is just another case of generically correct results being returned. – J. M. will be back soon Mar 26 '19 at 1:16
• @MsTais You'll have to define the curl as a distribution. As a function, it's zero (generically, but undefined at the origin); as an improper integral, it is zero. – Michael E2 Mar 26 '19 at 1:17