Steply

Derivative of y = x^(sin x) using logarithms

Step by step, with the reason for every step · Logarithmic differentiation · Calculus 1

Step by step

The question

Question: find dy/dx for y = x^(sin x), using logarithms.

y = x^(sin x)

x is in the base and in the power.

The power rule needs a fixed power.

The bˣ rule needs a fixed base.

Neither works, so we take ln.

x is in the base AND the power

Careful!

The power rule is only for a fixed power.

Here the power changes with x.

Careful: not x^(sin x) → (sin x)x^(sin x − 1) ✗

1 Take ln of both sides

Take ln of both sides.

Both sides stay equal.

ln y = ln(x^(sin x))

2 Use the log rules

The log rule: a power inside ln comes down in front.

ln(a^b) = b ln a

So ln y is sin x, times ln x.

No more power!

ln y = (sin x) ln x

3 The derivative of each side

The left side: y depends on x, so the chain rule gives 1/y, times dy/dx.

(ln y)′ = 1y × dydx

The right side is a product: use the product rule.

sin x, gives cos x, and ln x gives 1 over x.

1ydydx = cos x × ln x + (sin x) × 1x

4 Multiply by y

Multiply both sides by y, to get dy/dx alone.

dydx = y(cos x × ln x + (sin x) × 1x)

5 Put y back

Put y = x^(sin x) back, and tidy the bracket: x^(sin x) (cos x ln x + sin x/x).

dydx = x^(sin x)(cos x ln x + sin xx)

6 Check

Let's check: the derivative is the slope.

At x = 2, our answer gives 0.3121, with a calculator in radians.

dy/dx at x = 2: 0.3121

Now the slope between two very close points: x = 2 and x = 2.001.

A calculator gives about 0.31.

Very close to 0.3121.

Right!

y(2.001) − y(2)0.001 ≈ 0.31

Let's look back.

First: take ln of both sides.

Then: use the log rules.

Then: the derivative of each side.

Then: multiply by y.

Then: put y back.

Last: check.

Answer
dydx = x^(sin x)(cos x ln x + sin xx)

Your turn

Try this one yourself, then check:

Find dy/dx for y = x^(2x)
Show the answer
dydx = x^(2x)(2 ln x + 2)

More from Logarithmic differentiation

The whole lesson: Logarithmic differentiation →