We know that a^b=e^(blna). Here, we say that x^cosx=e^(cosxlnx).
According to the chain rule, (df)/dx=(df)/(du)*(du)/dx, where u is a function within f.
Here, f=e^u where u=cosxlnx, so we have:
d/(du)e^u*d/dx(cosxlnx)
e^ud/dx(cosxlnx)
According to the product rule, (f*g)'=f'g+fg'. Here, f=cosx and g=lnx, so we have:
d/dxcosx*lnx+d/dxlnx*cosx
-sinxlnx+1/xcosx
cosx/x-sinxlnx
So we have:
e^u(cosx/x-sinxlnx), but as u=cosxlnx, we have:
e^(cosxlnx)(cosx/x-sinxlnx), but remember that e^(cosxlnx)=x^cosx, so we have:
x^cosx(cosx/x-sinxlnx)