Weierstrass substitution
/ VY-er-shtrahss /
What if a trig integral is so mixed up — say 1 / (2 + cos x) — that the odd/even tricks do not bite? The Weierstrass substitution is the universal escape hatch: set t = tan(x/2), and every trigonometric function turns into a rational function of t. This single change of variable converts any integral of a rational expression in sin and cos into an integral of a plain rational function, which partial fractions can always finish.
The magic comes from three identities that follow from the half-angle formulas: with t = tan(x/2), you have sin(x) = 2t / (1 + t^2), cos(x) = (1 - t^2) / (1 + t^2), and dx = 2 dt / (1 + t^2). Substitute all three and the trig vanishes entirely, leaving a ratio of polynomials in t. That is why it is sometimes called the universal substitution: it never fails on a rational function of sin and cos, even when no clever shortcut exists.
Because it always works, it is a comforting last resort — but it is rarely the prettiest path, since it can manufacture a high-degree rational function whose partial-fraction work is heavy. The honest caveat is that t = tan(x/2) blows up at x = pi (an odd multiple of pi), so on an interval containing such a point the substitution is improper there and you should split the integral or argue by continuity; for a definite integral over a full period this needs care.
integral of dx / (2 + cos x): with t = tan(x/2) it becomes the integral of [2 dt / (1 + t^2)] / [2 + (1 - t^2)/(1 + t^2)] = 2 dt / (3 + t^2), an elementary arctangent.
One substitution dissolves the trig into a rational function — here straight to an arctangent.
It is universal but seldom optimal: it can produce a needlessly high-degree rational function. Reach for the odd/even trig tricks first, and keep this in reserve for the cases nothing else cracks.