The argument principle in complex analysis states that for a meromorphic nonconstant function on an open subset and a closed curve bounding a compact subset inside , we have
where and are the zeros and poles of inside , is the winding number of around , and is the multiplicity of at .
In this Demonstration the zeros and poles of a chosen function lying in the disk around the origin of radius 2 are shown as red and blue points (multiple zeros are shown as single points).
The path of integration initially consists of the red square; you can change its position and shape by dragging, adding, or subtracting the locator points. The value of the integral along the path (in the clockwise direction) is shown below. By unchecking the "closed curve" checkbox you can construct nonclosed curves by separating the two locators in the bottom-left corner.