The complex conjugate is . From the complex sine and cosine identities,
Divide these expressions and multiply by the complex conjugate of the denominator. Its squared modulus is . The numerator simplifies using and the double-angle formulas. Thus
These expressions apply except at the poles , with integer , where the original tangent function is undefined.
The double-angle formula gives . Setting reduces the equation to . On , the sine is nonnegative, so only is allowed. Therefore
The cardioid has a nonnegative radial boundary, so each ray from the origin contributes . Integrating the polar coordinates area element yields
The three angular integrals are , zero and , respectively, using the double-angle formula for the last. Thus
Choose the trigonometric substitution with . The cosine is nonnegative there, so and . The double-angle formula then gives
Since and ,
The formula is an antiderivative on and has continuous endpoint values at .
Using the Pythagorean trigonometric identity and the double-angle formula,
The required value therefore occurs when . Within , the only possibilities are and . Hence
Equivalently equality requires .