What am I missing?
Consider: $$ \int \frac{x^4}{\left(1-x^2\right)^{5/2}} dx$$
If we let $x = \sin \theta$ we get
$$ \int \frac{\sin^4 \theta}{\cos^5 \theta} \cos \theta d\theta$$
as $dx = \cos \theta d\theta$. We can simplify the above expression to
$$ \int \tan^4 \theta d \theta$$
However, if we let $x = \cos \theta$ we get
$$ -\int \frac{\cos^4 \theta}{\sin^5 \theta} \sin \theta$$
as $dx = - \sin \theta d\theta$.
We can simplify the above expression to
$$ -\int \cot^4 \theta d\theta$$
Now, the two simplified expressions are equal since they are equal to the original expression. So we have the following equality:
$$ \int \tan^4 \theta d\theta = -\int \cot^4 \theta d\theta$$ $$ \frac{d}{d\theta} \int \tan^4 \theta d\theta = \frac{d}{d\theta}\left( -\int \cot^4 \theta d\theta\right)$$
The derivative of the integral is the same as the function so
$$\tan^4 \theta = -\cot^4 \theta$$
The $\theta$s in the two susbtitutions are two variables, say $\theta$ and $\theta^\prime:=\pi/2-\theta$ so $\cot^4\theta^\prime=\tan^4\theta$. The extra $-$ sign follows from $d\theta^\prime=-d\theta$.