What was the intuition behind the Weierstrass substitution? I was curious about how we let $t = \tan(x/2)$ when we perform this technique. Correct me if I am wrong, but is the purpose of letting $t = \tan(x/2)$ is simply just to eliminate the square roots?
 A: It's used in converting functions like $f(\sin x,\cos x)$  into rational functions which have a established way to solve.
Stems from that,
$\sin x=\frac{2\tan{\frac{x}{2}}}{1+\tan^2\frac{x}{2}}$
$\cos x=\frac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}$
So if there are other relations,we can use better substitution such as

*

*$f(-\sin x,\cos x)=-f(\sin x,\cos x)$,let $t=\cos x$


*$f(\sin x,-\cos x)=-f(\sin x,\cos x)$,let $t=\sin x$


*$f(-\sin x,-\cos x)=f(\sin x,\cos x)$,let $t=\tan x$
Hope my answer is helpful.
A: Let's say you want a substitution to evaluate an integral $\int f(\cos\theta,\sin\theta)\,\mathrm{d}\theta$, where $f$ is a rational function. You'll want your substitution to itself be a trig function and ideally all trigonometry goes away and you're left with algebra. One thing to observe is that $(\cos\theta,\sin\theta)$ parametrizes the unit circle, whereas $x$ (in the usual $\mathrm{d}x$ integrals) tends to parametrize intervals on the real number line. This suggests something to investigate: what happens if you convert between these coordinates? The standard way to do this is with stereographic projection, although there are many ways to set up such a projection. Arguably the breeziest way to do this is by projecting onto the $y$-axis, since then the coordinate $t$ in the point $(0,t)$ is simply the slope of the line through the points $(-1,0),(0,t),(\cos\theta,\sin\theta)$. The inscribed angle theorem says this line makes an angle of $\theta/2$ with the $x$-axis, so $t=\tan(\theta/2)$. We can work out $\cos\theta,\sin\theta,\mathrm{d}\theta$ in terms of $t,\mathrm{d}t$ - fortuitously,
$$ \int f(\cos\theta,\sin\theta)\,\mathrm{d}\theta = \int f\Big(\frac{1-t^2}{1+t^2},\frac{2t}{1+t^2}\Big)\frac{2\,\mathrm{d}t}{1+t^2}, $$
which means the Weierstrass substitution turns the integrand completely rational.
To investigate this substitution further, we can derive $\cos(\theta/2)$ and $\sin(\theta/2)$ in terms of $t$, which involves the radical $\sqrt{1+t^2}$. Then we can use the substitution to convert radical to trig integrand:
$$ f\big(t,\sqrt{1+t^2}\,\big)\,\mathrm{d}t= f\big(\tan(\theta/2),\sec(\theta/2)\big)\sec^2(\theta/2)\,\mathrm{d}(\theta/2)=g(\cos\psi,\sin\psi)\,\mathrm{d}\psi $$
We can do something similar with hyperbolic tangent and $\sqrt{1-t^2}$. By completing the square and using an affine transformation, this allows us to integrate $f(x,\sqrt{Q(x)})\,\mathrm{d}x$ for any quadratic $Q(x)$ and rational function $f$, though first we must simplify the numerator and denominator and rationalize to get it in the form $A(x)+B(x)/\sqrt{Q(x)}$ where $A$ and $B$ are rational functions.
Replacing $Q$ with a cubic (or even quadric) polynomial, we can use a substitution with the Weierstrass $\wp$ function, since $(\wp,\wp')$ parametrizes an elliptic curve.
