Finding the integral variables 
Is it okay to say, for example, $\displaystyle \int \dfrac{x^2}{x^3+1}dt$ if $t$ is a function of $x$? 

I was doing a trig substitution for a trig problem and I had intermediate steps where I had something like that but someone told me I can't say that since the integral means $x$ is independent of $t$. I thought I could because $t$ is a function of $x$.
For a more concrete example, let $x = \sin(t)$. I said $\displaystyle \int \dfrac{\sqrt{1-x^2}}{x^2}dx = \int \dfrac{\sqrt{1-\sin^2(t)}}{\sin^2(t)}dx$. Is this valid?
 A: You can perform substitution but you can't ignore the meaning of the differential symbol $dx$ and $dt$ so by letting:
$$x = \sin(t)$$
you must calculate:
$$dx = \cos(t) \,dt$$
so that:
$$\int \dfrac{\sqrt{1-x^2}}{x^2} \, dx$$
becomes
$$\int \dfrac{\sqrt{1-\sin^2(t)}}{\sin^2(t)} \cos(t) \, dt.$$
The general concept is generally discussed under 'Integration by substitution'. You can read more about it here integration-by-substitution.
A: There's nothing wrong with that, but of course you must keep track of the distinction between $dt$ and $dx$.  The sort of thing you mention is done routinely in things like this:
$$
\int \arctan x\,dx = \underbrace{\ \int u\,dx = xu - \int x\,du}_\text{integration by parts} = x\arctan x - \int x \frac{dx}{1+x^2}= \text{etc.}
$$
A: Depends on your favourite definition of the integral.
At worst it constitutes a mild abuse of notation to indicate that the integrand is multiplied by the derivative of the function.
At best it is part of the definition, see "Riemann-Stieltjes integral".
