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. ThusThese 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 yieldsThe 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 givesSince and ,The formula is an antiderivative on and has continuous endpoint values at .
The double-angle formula for the tangent function gives . Here , because , so the denominator is nonzero. Rearranging yields the quadratic equation
Using the Pythagorean trigonometric identity and the double-angle formula,The required value therefore occurs when . Within , the only possibilities are and . HenceEquivalently equality requires .