We can use the identity tanx = sinx/cosx and then differentiate using quotient rule (and the fact that d/dx[sinx] = cosx and d/dx[cosx] = -sinx):
y = sinx / cosx
dy/dx = [cosx·cosx - (-sinx)(sinx)] / cos2x [(deriv of top)·bottom - (deriv of bottom)·top] / bottom2
= [cos2x + sin2x] / cos2x
= 1 / cos2x
= sec2x (since secx = 1/cosx)