How do you differentiate #f(x)=(1/(3x))*x*e^x-x*cosx# using the product rule?
Please see below.
We do not need the product rule for the first term, although you may use it if you like.
For the second term, we need the product rule. (unless we do something unusual.)
# = cosx-xsinx#
Putting it all together,