The power rule handles x5 (variable base, constant power) and the exponential rule handles 5x (constant base, variable power). But what about xsinx — variable to a variable power? Neither rule applies. The escape is to take logarithms first.
For y=[u(x)]v(x):
Take logs:logy=v(x)logu(x) — the awkward power becomes an ordinary product.
Differentiate both sides (chain rule on the left, product rule on the right):
y1dxdy=v(x)⋅u(x)u′(x)+v′(x)logu(x)
Multiply back by y:dxdy=y[u(x)v(x)u′(x)+v′(x)logu(x)]
The fine print:f(x) and u(x) must be positive — otherwise their logarithms are undefined and the whole method has no meaning. Exam problems supply the interval (e.g. x>0 for xsinx) precisely for this reason.
Two instant corollaries
Constant base:y=ax (a>0): logy=xloga, so
dxd(ax)=axloga
The classic xx:logy=xlogx, so y1y′=logx+1 and
dxd(xx)=xx(1+logx)
Products and quotients love logarithms too
Even with no variable powers in sight, logs turn heavy products into light sums. For y=3x2+4x+5(x−3)(x2+4) under a square root, taking logs gives
logy=21[log(x−3)+log(x2+4)−log(3x2+4x+5)]
and differentiating term by term beats any quotient-rule slog. The keep-it-straight table:
Shape
Tool
xa (constant power)
power rule: axa−1
ax (constant base)
axloga
u(x)v(x) (both vary)
logarithmic differentiation
big products/quotients
logs first, then term-by-term
Solved Examples
Example 1 — The constant-base corollary
Differentiate ax w.r.t. x, where a is a positive constant.
Step 1 — take logs:logy=xloga.
Step 2 — differentiate:y1dxdy=loga.
Answer:dxdy=axloga. (Alternatively, ax=exloga and one chain-rule link gives the same.) In particular dxd2x=2xlog2 — and for a=e, loge=1 recovers dxdex=ex.
Example 2 — The flagship xsinx
Differentiate xsinx, x>0, w.r.t. x.
Step 1 — take logs:logy=sinxlogx.
Step 2 — product rule on the right:y1dxdy=cosxlogx+xsinx.