I use integration by parts. It works for any non-self intersecting polygon (I hate those weirdos). If there is a…