How do you differentiate y = x^(cos x)?

2 Answers
Mar 8, 2018

The answer is =(1/xcosx-lnxsinx)x^(cosx)

Explanation:

The function is

y=x^(cosx)

Taking logarithms on both sides

lny=ln(x^(cosx))=cosxlnx

Differentiating both sides

(lny)'=(cosxlnx)'=(cosx)'lnx+cosx(lnx)'

1/ydy/dx=-sinx*lnx+cosx*1/x

dy/dx=(1/xcosx-lnxsinx)y

=(1/xcosx-lnxsinx)x^(cosx)

Mar 8, 2018

x^cosx(cosx/x-sinxlnx)

Explanation:

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)