I need intuition as to how trig substitution works. Let's start with an example:
$$
\int \frac{1}{\sqrt{4-x^2}}dx;
$$
using a reference triangle, I find that $\sqrt{4-x^2}$ can be expressed as $2\cos\theta$ in polar coordinates.
However, I don't understand how $dx$ can be replaced with $2\cos(\theta)d\theta$.

It was to my understanding that if something is added to right side of the integral -> $2\cos(\theta)$ then it must also be added the the left side of the integral. The fact that $2\cos(\theta)$ contains a variable would not allow that. I understand that trig substitution like this does work. I just can't seem to understand how.
 A: Here is one way to think about it. You want to find the integral
$$
\int \frac{1}{\sqrt{4 - x^2}}\; dx
$$
From experience you know that square roots in integrals causes problems. The standard way to deal with them is substitution. You put $u$ equal to the stuff under the root sign. This, however, requires the derivative of this inner function to appear on the outside. In this case you do not have a $-2x$ on the outside.
It would be nice if we could write $4 - x^2$ as the square of something. That square would then cancel the square root, and you would be a bit closer to solving the problem.
The trick is to realize that if $y^2 = 4 - x^2$, then $x$ and $y$ can be thought of as being on a circle of radius $2$. You know with polar coordinates that one way to describe circles is with polar coordinates. So this gives you the idea of bringing in the trigonometric functions. You then recall the identities
$$
\begin{align}
\sin^2(x) + \cos^2(x) &= 1 \\
\tan^2(x) + 1 &= \sec^2(x).
\end{align}
$$
So you see that $1 - \sin^2(x) = \cos^2(x)$ and this sort of looks like $4 - x^2 = y^2$. Fiddling around a bit, you see that if $x = 2\sin(\theta)$, then $4 - x^2 = 4 - 4\sin^2(\theta) = 4(1 - \sin^2(\theta) = (2\cos(\theta))^2$. So now you have written the stuff under the square root as the square of something else. \emph{And so on ...}

Now, here is the thing. You are actually not doing anything new with trigonometric substitution. What you are doing is making the substitution
$$
\theta = \sin^{-1}\left(\frac{x}{2}\right).
$$
Treating this as a "normal" substitution, you take the derivative
$$
d\theta = \frac{1}{\sqrt{1 - (x/2)^2}}\frac{1}{2}\;dx = \frac{1}{\sqrt{4 - x^2}}\; dx.
$$
So you get
$$
\int \frac{1}{\sqrt{1-x^2}}\; dx = \int 1 \; d\theta = \theta + C = \sin^{-1}\left(\frac{x}{2}\right) + C
$$
So to answer your question about why the $dx$ above should be replaced by $d\theta$, the answer is: for the same reason that you change the $dx$ in a normal substitution problem.
A: if you suppose that $x=2sin(\theta )$ , then you will obtain $dx=2cos(\theta )d\theta$ and $\sqrt{4-x^{2}}=\sqrt{4-4sin(\theta)^{2}}=2\left | cos(\theta) \right |$
A: What you know is that $\sqrt{4 - x^2} = 2\cos\theta$. Doing a bit of manipulation,
$$
\begin{aligned}
4-x^2 &= 4\cos^2\theta \\
x^2 &= 4 - 4\cos^2\theta \\
x^2 &= 4\sin^2\theta \\
x &= 2\sin\theta
\end{aligned}
$$
Deriving this, we obtain that, given $dy = (y)'$ - ($y$ stands for any variable),
$$
dx = 2d(\sin\theta) = 2\cos\theta d\theta
$$.
