Let the given function be,
f( x )=( x+cosx )( x−tanx )
Differentiate the function with respect to x,
f ′ ( x )=( x+cosx ) d dx ( x−tanx )+( x−tanx ) d dx ( x+cosx ) =( x+cosx )[ d dx x− d dx tanx ]+( x−tanx )[ d dx x+ d dx cosx ] =( x+cosx )( 1− sec 2 x )+( x−tanx )( 1−sinx ) =− tan 2 x( x+cosx )+( x−tanx )( 1−sinx )
Therefore, the derivative of the given function is − tan 2 x( x+cosx )+( x−tanx )( 1−sinx ).