We're asked to find the derivative
#d/(dx) [(2x^2 + 7x  2)/(xcosx)]#
Use the quotient rule, which is
#d/(dx) [u/v] = (v(du)/(dx)  u(dv)/(dx))/(v^2)#
where

#u = 2x^2 + 7x  2#

#v = x  cosx#:
#= ((xcosx)(d/(dx)[2x^2 + 7x  2])(2x^2 + 7x  2)(d/(dx)[xcosx]))/((xcosx)^2)#
The derivative of #2x^2 + 7x  2# is #4x + 7# (use power rule for each term):
#= ((xcosx)(4x+7)(2x^2 + 7x  2)(d/(dx)[xcosx]))/((xcosx)^2)#
The derivative of #x# is #1# (power rule) and the derivative of #cosx# is #sinx#:
#= color(blue)(((xcosx)(4x+7)(2x^2 + 7x  2)(1+sinx))/((xcosx)^2)#
Which can also be written as
#= color(blue)((4x+7)/(xcosx)  ((2x^2 + 7x  2)(1+sinx))/((xcosx)^2)#