You can solve it like this:
$\displaystyle \begin{align*} \frac{d}{dy}\int_{\cos^{2}(y)}^{\sin^{2}(y)}\frac{ 1}{t} dt =& \frac{d}{dy}\left( \ln(t) \Big{|}^{\sin^{2}(y)}_{\cos^{2}(y)}\right) \\ =& \frac{d}{dy}[\ln{(\sin^{2}(y))} - \ln{(\cos^{2}(y))}] \\ =& \frac{2 \sin(y) \cos(y)}{\sin^{2}(y)} + \frac{2 \sin(y) \cos(y)}{\cos^{2}(y)} \\ =& \frac{2\sin(y)\cos^{3}(y) + 2\sin^{3}(y)\cos(y)}{\sin^{2}(y)\cos^{2}(y)} \\ =& \frac{2\sin(y)\cos(y)(\sin^{2}(y) + \cos^{2}(y))}{\sin^{2}(y)\cos^{2}(y)} \\ =& \frac{2\sin(y)\cos(y)}{\sin^{2}(y)\cos^{2}(y)} \\ =& 2\csc(y)\sec(y) \end{align*}$