I am working on solving the problem stated in this image:

I understand almost everything about this problem. I solved for the magnetic field along the axis of a circular loop, and now I need to integrate from Ө1 to Ө2.
The problem I am encountering is that I am not sure how to put dz in terms of dӨ. Here is how the example does it:

Can someone explain these steps to me? I pretty much understand every step here except for this one:
$$ \frac{d\theta}{\cos^2\theta} = -\frac a{z^2}\,dz $$
Thanks for your help!
Given:
$$ \tan \theta = \frac az$$
Now perform differentiation on both sides against some dummy variable $t$:
\begin{align} \frac{d}{dt}\tan\theta &= \frac{d\theta}{dt} \sec^2\theta \\ \frac{d}{dt}\frac az &= -\frac{dz}{dt} \frac{a}{z^2}. \end{align}
"Eliminate" the $dt$ and use $\sec\theta=\frac1{\cos\theta}$.
$$\frac{d\theta}{\cos^2\theta} = -\frac{a}{z^2}dz.$$