Numerical Surface Integrals in Python

Photo: Rhett Allain. Area element in Cartesian and polar coordinates.

Let’s say you wanted to calculate the area of a circle. Oh, I know the answer already, but let’s just pretend. Also, for fun suppose you want to do this numerically by breaking the circle into many tiny pieces and finding the sum of the areas of the pieces. How would you do that?

I’ll be honest. I don’t want to find the area of a circle. I want to find the magnetic flux through a circle for a…