The following differentiated implicitly with respect to $\theta$:
$3x = \tan \, \theta $
The book says
$3 dx = \sec^2 \theta \, d \theta$
One could start the calculation like this (I think):
$ \frac{d}{d \theta}3x = \frac{d}{d \theta} \tan \, \theta $
From there I'm not really sure about the steps.