# Weierstrass substitution

In integral calculus, the Weierstrass substitution or tangent half-angle substitution is a method for evaluating integrals, which converts a rational function of trigonometric functions of ${\displaystyle x}$ into an ordinary rational function of ${\displaystyle t}$ by setting ${\displaystyle t=\tan(x/2)}$.[1][2] No generality is lost by taking these to be rational functions of the sine and cosine. The general transformation formula is

${\displaystyle \int f(\sin(x),\cos(x))\,dx=\int f\left({\frac {2t}{1+t^{2}}},{\frac {1-t^{2}}{1+t^{2}}}\right){\frac {2\,dt}{1+t^{2}}}.}$

It is named after Karl Weierstrass (1815–1897),[3][4][5] though it can be found in a book by Leonhard Euler from 1768.[6] Michael Spivak wrote that this method was the "sneakiest substitution" in the world.[7]