The derivative of this can be done with just the quotient rule, but you're free to give your answer simplified in many ways.
#d/(dx)([3x - sinx]/(cosx)) = [(cosx*(3-cosx)) - ((3x-sinx)*-sinx)]/(cos^2x)#
#= [3cosx-cos^2x - (-3xsinx+sin^2x)]/(cos^2x)#
#= [3cosx-cos^2x + 3xsinx - sin^2x]/(cos^2x)#
#= 3/(cosx) - 1+ (3xsinx-sin^2x)/(cos^2x)#
#= 3secx + (3xsinx-sin^2x)(sec^2x) - 1#
or
#= [3cosx + 3xsinx - (sin^2x + cos^2x)]/(cos^2x)#
#= [3cosx + 3xsinx - 1]/(cos^2x)#
#= 3secx + 3xsecxtanx - sec^2x#
#= - sec^2x + 3secx + 3xsecxtanx#
or from Wolfram Alpha:
#(3-cosx)secx+(3x-sinx)(secxtanx)#