Periodicity reduces all the indicated vertical segments to the compact segment , which misses every pole. Continuity therefore gives the first uniform bound. In fact an explicit identity gives a stronger estimate for every real :
Thus we can take .
Write . On the vertical sides of the square the same bound holds, since both real coordinates are half-integers. On either horizontal side . For , put , so . Using
gives . Conjugation gives the same estimate below the real axis. Hence an explicit bound valid on every square is
For , the contour has length and every point on it has . The reverse triangle inequality yields , so the ML inequality gives
Orient the square positively. Its enclosed poles at the integers have residues . Since is nonintegral, the additional poles and are distinct from those integers and from one another. Their residues are and , both equal to because is odd. Their combined contribution is therefore .
The residue theorem gives
The series is absolutely convergent, since its terms are . Taking the limit, then including the term, yields
This is cotangent contour summation. Keeping the term separate until the last step determines the sign of the contribution.
For a pole of order at , the residue is . For the rational integral, close the real-axis contour with an upper semicircle. The poles are double at and simple at , with
The arc integral vanishes as . By the residue theorem the whole real-axis integral is , and evenness gives
For the second calculation, reciprocal expansion of the sine gives . Multiplying by yields . Therefore
At every nonzero integer , has a simple pole with residue one, giving residue after division by .
The cotangent contour summation uses the positively oriented square of half-side . Its length is and on its boundary. The supplied cotangent bound implies . Its enclosed residues sum to . The residue theorem therefore proves the Basel problem value
Figure 1.
Upper-half-plane and square contours for the rational integral and the Basel sum
. Original contour diagrams. Both are counterclockwise. The upper semicircle encloses poles at and ; the example square has half-side , enclosing the integer poles from to . Details.
For fixed , integrate
counterclockwise around the specified square of half-side , choosing . The integer poles inside it are , and their residues are because has residue one at each integer.
The two other possible poles are and . Their residues are each , hence sum to . This formula still applies when the numerator vanishes and a possible pole is removable. The residue theorem gives
On the square, , its perimeter is , and the supplied cotangent bound gives
The series converges absolutely by part (b), so its symmetric partial sums have the same limit as the full sum. Therefore
At half-integers the cotangent form makes the value zero explicit; the reciprocal-tangent notation is understood by its continuous extension there. The cotangent contour summation rests on the contour estimate, not only on formally matching poles.