When doing integration by substitution, why can dx be converted in terms of dy? The fact that derivatives are not fractions is confusing me. Suppose I have $$\int \frac{1}{1+x^2} dx$$
I would let $x = tan(\theta)$, and $dx = sec^2(\theta) d\theta$, replacing dx with the corresponding term. 
I am guessing this arises by taking the derivative of the first equation: $dx/d\theta = sec^2(\theta)$, but if derivatives are not fractions, why are you allowed to break up the $dx$ and $d\theta$ into the latter equation? And, if you restrict yourself to proper math, how do you eventually arrive at $dx = sec^2(\theta) d\theta$?
 A: Being careful, change of variable amounts to the two identities
$$\int_a^b f'(g(x)) g'(x) dx = f(g(b))-f(g(a))=\int_{g(a)}^{g(b)} f'(x) dx.$$
The first identity uses the fact that $f'(g(x)) g'(x)=(f(g(x))'$, along with the fundamental theorem of calculus. The second identity is just the fundamental theorem of calculus.
In the common notation for change of variable, we denote $g(x)$ by $u$ and $g'(x)$ by $\frac{du}{dx}$, and then we write $\frac{du}{dx} dx = du$. If you want to be more mathematically careful, you can treat this last step as just being notation, and solely think of change of variable using these two identities.
Your example is sort of awkward for conveying this point because in this notation you're basically taking $g(x)=\arctan(x)$ and $f(x)=x$, which could just as easily be done with the fundamental theorem of calculus without bringing the chain rule into play. A better example would be 
$$\int_a^b \frac{2x}{x^2+1} dx.$$
In this case you have $g(x)=x^2+1,g'(x)=2x,f'(x)=1/x$. So you can select $f(x)=\ln(x)$ and the definite integral is $\ln(b^2+1)-\ln(a^2+1)$.
