Derivative of a Function Raised to a Function

To differentiate a function of the form $$ y=[f(x)]^{g(x)} $$ where both the base and the exponent depend on \(x\), it is helpful to use the natural logarithm. The derivative is given by the formula $$ D\left([f(x)]^{g(x)}\right)=[f(x)]^{g(x)}\left[g'(x)\ln f(x)+\frac{g(x)f'(x)}{f(x)}\right] $$ provided that \(f(x)>0\) on the interval considered and that both \(f(x)\) and \(g(x)\) are differentiable.

At first glance, a function such as \([f(x)]^{g(x)}\) may look difficult to differentiate because both the base and the exponent vary. Fortunately, logarithmic differentiation turns the problem into a straightforward application of familiar derivative rules.

Taking the natural logarithm of both sides transforms the power into a product:

$$ \ln y=g(x)\ln f(x) $$

Once the expression has been rewritten in this form, the derivative can be found using the derivative of the natural logarithm and the product rule.

This technique is known as logarithmic differentiation and is the standard method for differentiating functions in which both the base and the exponent depend on the variable.

A Worked Example

Find the derivative of

$$ y=x^x $$

Here,

$$ f(x)=x $$

and

$$ g(x)=x $$

Their derivatives are

$$ f'(x)=1 $$

$$ g'(x)=1 $$

Substituting these values into the formula gives

$$ D(x^x) = x^x \left[ 1\cdot \ln x+\frac{x\cdot 1}{x} \right] $$

After simplification, we obtain

$$ D(x^x) = x^x(\ln x+1) $$

This result is valid for \(x>0\), since the natural logarithm \(\ln x\) is defined only for positive values of \(x\).

Example 2

Find the derivative of

$$ y=(x^2+1)^x $$

This function has the form \( [f(x)]^{g(x)} \), where

$$ f(x)=x^2+1 $$

and

$$ g(x)=x $$

The derivatives are

$$ f'(x)=2x $$

$$ g'(x)=1 $$

Applying the formula,

$$D\left([f(x)]^{g(x)}\right) =[f(x)]^{g(x)}\left[g'(x)\ln[f(x)] +\frac{g(x)f'(x)}{f(x)}\right]$$

and substituting the known quantities,

$$ y' = (x^2+1)^x \left[ 1\cdot\ln(x^2+1) + \frac{x\cdot 2x}{x^2+1} \right] $$

which simplifies to

$$ y' = (x^2+1)^x \left[ \ln(x^2+1) + \frac{2x^2}{x^2+1} \right] $$

Since \(x^2+1\) is always positive, the logarithm \(\ln(x^2+1)\) is defined for every real value of \(x\). Therefore, the formula can be applied for all real numbers.

Proof of the Formula

Consider the function

$$ y=[f(x)]^{g(x)} $$

Because both the base and the exponent vary with \(x\), the ordinary power rule does not apply directly.

Assuming \(f(x)>0\), we can take the natural logarithm of both sides:

$$ \ln y=\ln\left([f(x)]^{g(x)}\right) $$

Using the logarithmic identity

$$ \ln(a^b)=b\ln a $$

we obtain

$$ \ln y=g(x)\ln f(x) $$

Differentiate both sides with respect to \(x\):

$$ D[ \ln y ]= D[ g(x)\ln f(x) ] $$

The left-hand side becomes

$$ D[ \ln y ]=\frac{1}{y}y' $$

Applying the product rule to the right-hand side gives

$$ D[ g(x)\ln f(x) ] =g'(x)\ln f(x)+g(x) ( \ln f(x) )' $$

$$ D[ g(x)\ln f(x) ] =g'(x)\ln f(x)+g(x)\frac{1}{f(x)}f'(x) $$

Therefore,

$$ \frac{1}{y}y' = g'(x)\ln f(x)+g(x)\frac{1}{f(x)}f'(x) $$

or equivalently,

$$ \frac{y'}{y} = g'(x)\ln f(x)+g(x)\frac{f'(x)}{f(x)} $$

Multiplying both sides by \(y\) gives

$$ y' = y\left[g'(x)\ln f(x)+\frac{g(x)f'(x)}{f(x)}\right] $$

Finally, replacing \(y\) with \([f(x)]^{g(x)}\), we obtain

$$ y' = [f(x)]^{g(x)} \left[g'(x)\ln f(x)+\frac{g(x)f'(x)}{f(x)}\right] $$

This is the desired formula.

The Special Case of a Constant Exponent

When the exponent is constant, the general formula simplifies to the familiar rule for differentiating a power of a function: $$ D[f(x)]^a = a[f(x)]^{a-1}f'(x) $$

Example

Find the derivative of

$$ y=(x^2+1)^3 $$

Here,

$$ f(x)=x^2+1 $$

and

$$ a=3 $$

Since the exponent is constant, we use

$$ D[f(x)]^a = a[f(x)]^{a-1}f'(x) $$

Substituting the values gives

$$ y' = 3(x^2+1)^{3-1}f'(x) $$

$$ y' = 3(x^2+1)^2f'(x) $$

Because

$$ f'(x)=2x $$

we obtain

$$ y' = 3(x^2+1)^2(2x) $$

$$ y' = 6x(x^2+1)^2 $$

This is the derivative of the function.

Proof

If the exponent is a constant \(a\), then

$$ g(x)=a $$

and therefore

$$ g'(x)=0 $$

Substituting these values into the general formula gives

$$ D[f(x)]^a = [f(x)]^a \left[ 0\cdot \ln f(x)+\frac{a f'(x)}{f(x)} \right] $$

$$ D[f(x)]^a = [f(x)]^a\frac{a f'(x)}{f(x)} $$

$$ D[f(x)]^a = a\frac{[f(x)]^a}{f(x)}f'(x) $$

Using the identity

$$ \frac{[f(x)]^a}{f(x)}=[f(x)]^{a-1} $$

we obtain

$$ D[f(x)]^a = a[f(x)]^{a-1}f'(x) $$

This is the standard rule for differentiating a power of a function.

Note. If \(f(x)=x\), then \(f'(x)=1\), and the formula reduces to the familiar power rule $$ D(x^a)=ax^{a-1} $$ with \(x>0\) when \(a\) is an arbitrary real number.

The same reasoning can be extended to many other types of composite functions.

 

 
 

Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

FacebookTwitterLinkedinLinkedin
knowledge base

Derivatives

Theorems

Various Derivatives

Exercises