Worked Examples of Function Derivatives
Below are several examples of derivatives, each solved step by step to show the full process.
| Example |
$$ \frac{d}{dx} \left(\frac{1}{\cos(x)}\right) $$ |
| Example | $$ \frac{d}{dx} \left(-\ln(\cos(x))\right) $$ |
| Example | $$ \frac{d}{dx} \arctan(\sin(x)) $$ |
| Example | $$ \frac{d}{dx} \left( 2e^{\sqrt{x}} \right) $$ |
| Example | $$ \frac{d}{dx} \frac{x}{2}(\ln(x) - 1) $$ |
| Example | $$ \frac{d}{dx} \left( -\frac{\cos(2x)}{2} \right) $$ |
| Example | $$ \frac{d}{dx}\left(\frac{1}{2}x + \frac{1}{8}\sin(4x)\right) $$ |
| Example | $$ \frac{d}{dx} \left( -\ln(1 + \cos^2(x)) \right) $$ |
Derivative Calculation - Example 1
In this example, we want to differentiate the following function:
$$ \frac{d}{dx}\left(\frac{1}{2}x + \frac{1}{8}\sin(4x)\right) $$
We start by applying the rule that states the derivative of a sum is equal to the sum of the derivatives:
$$ \frac{d}{dx} \left( \frac{1}{2}x \right) + \frac{d}{dx} \left( \frac{1}{8}\sin(4x) \right) $$
Since the derivative of a constant times a function equals the constant multiplied by the derivative of that function, we can factor out the constants 1/2 and 1/8:
$$ \frac{1}{2} \cdot \frac{d}{dx}(x) + \frac{1}{8} \cdot \frac{d}{dx}(\sin(4x)) $$
Knowing that the derivative of \(x\) is 1, we have:
$$ \frac{1}{2} \cdot 1 + \frac{1}{8} \cdot \frac{d}{dx}(\sin(4x)) $$
$$ \frac{1}{2} + \frac{1}{8} \cdot \frac{d}{dx}(\sin(4x)) $$
To differentiate \(\sin(4x)\), we apply the chain rule.
Recall that the derivative of \(\sin(u)\) is \(\cos(u)\cdot u'\). Here, \(u = 4x\), so \(u' = 4\):
$$ \frac{1}{2} + \frac{1}{8} \cdot (4 \cos(4x)) $$
$$ \frac{1}{2} + \frac{1}{2} \cos(4x) $$
$$ \frac{1}{2} \big( 1 + \cos(4x) \big) $$
Therefore, the derivative of \(\frac{1}{2}x + \frac{1}{8}\sin(4x)\) is:
$$ \frac{d}{dx}\left(\frac{1}{2}x + \frac{1}{8}\sin(4x)\right) = \frac{1}{2} \big( 1 + \cos(4x) \big) $$
This is our result for the derivative.
Note. The result above is already correct and acceptable as a final answer. However, we can simplify it further using trigonometric identities. In particular, from the double-angle formula for cosine we know that \( \cos(4x) = 2 \cos^2(2x) - 1 \). Applying this identity:
$$ \frac{1}{2} \cdot \big( 1 + \cos(4x) \big) $$
$$ \frac{1}{2} \cdot \big( 1 + 2\cos^2(2x) - 1 \big) $$
$$ \frac{1}{2} \cdot 2\cos^2(2x) $$
This simplifies to:
$$ \cos^2(2x) $$
Thus, the simplified derivative of \(\frac{1}{2}x + \frac{1}{8}\sin(4x)\) is \(\cos^2(2x)\):
$$ \frac{d}{dx}\left(\frac{1}{2}x + \frac{1}{8}\sin(4x)\right) = \cos^2(2x) $$
However, it’s not always necessary to simplify to this final form. Whether or not you simplify depends on the problem and the context in which you’re working. In many cases, leaving the derivative in its original form is perfectly fine.
Derivative Calculation - Example 2
In this example, we’re going to differentiate the function:
$$ f(x) = \frac{x}{2} \big( \ln(x) - 1 \big) $$
Let’s work through it step by step.
$$ f'(x) = \frac{d}{dx} \left( \frac{x}{2} \cdot \ln(x) - \frac{x}{2} \right) $$
This is the derivative of an algebraic sum of two functions.
Since the derivative of a sum is equal to the sum of the derivatives, we can rewrite it as:
$$ f'(x) = \frac{d}{dx} \left( \frac{x}{2} \cdot \ln(x) \right) - \frac{d}{dx} \left( \frac{x}{2} \right) $$
In both terms, we have a constant multiplied by a function. By the rule that the derivative of \(k \cdot g(x)\) equals \(k \cdot g'(x)\), we can factor out the 1/2 constant from both derivatives:
$$ f'(x) = \frac{1}{2} \cdot \frac{d}{dx} \big( x \cdot \ln(x) \big ) - \frac{1}{2} \cdot \frac{d}{dx}(x) $$
To differentiate \(x \cdot \ln(x)\), we apply the product rule:
$$ f'(x) = \frac{1}{2} \cdot \left[ \left( \frac{d}{dx} x \right) \cdot \ln(x) + x \cdot \frac{d}{dx} \ln(x) \right ] - \frac{1}{2} \cdot \frac{d}{dx}(x) $$
We know that the derivative of \(x\) is 1, and the derivative of the natural logarithm is \(1/x\):
$$ f'(x) = \frac{1}{2} \cdot \big( 1 \cdot \ln(x) + x \cdot \frac{1}{x} \big ) - \frac{1}{2} \cdot \frac{d}{dx}(x) $$
$$ f'(x) = \frac{1}{2} \cdot \big( \ln(x) + 1 \big ) - \frac{1}{2} \cdot \frac{d}{dx}(x) $$
Calculating the last derivative (since \(\frac{d}{dx}(x)=1\)):
$$ f'(x) = \frac{1}{2} \big( \ln(x) + 1 \big ) - \frac{1}{2} \cdot 1 $$
$$ f'(x) = \frac{1}{2} \big( \ln(x) + 1 \big ) - \frac{1}{2} $$
$$ f'(x) = \frac{\ln(x)}{2} + \frac{1}{2} - \frac{1}{2} $$
$$ f'(x) = \frac{\ln(x)}{2} $$
We can also express \( \frac{1}{2} \ln(x) \) using the properties of logarithms, which tell us that \( \ln(a^b) = b \ln(a) \):
$$ f'(x) = \frac{1}{2} \ln(x) = \ln\left( x^{\frac{1}{2}} \right) $$
Since raising a number to the power of \(\frac{1}{2}\) is the same as taking the square root, \( a^{1/2} = \sqrt{a} \), we can rewrite the result as:
$$ f'(x) = \ln(\sqrt{x}) $$
Thus, the derivative of the function \( f(x) = \frac{x}{2}(\ln(x) - 1) \) is:
$$ f'(x) = \frac{d}{dx} \left( \frac{x}{2} \big(\ln(x) - 1\big) \right ) = \ln(\sqrt{x}) $$
Derivative Calculation - Example 3
In this example, we’re going to find the derivative of the following function:
$$ f'(x) = \frac{d}{dx} \left( -\frac{\cos(2x)}{2} \right) $$
The constant factor \(-\frac{1}{2}\) multiplies the function \(\cos(2x)\), so we can factor it out of the derivative:
$$ f'(x) = \frac{d}{dx} \left( -\frac{1}{2} \cos(2x) \right) $$
$$ f'(x) = -\frac{1}{2} \cdot \frac{d}{dx} \cos(2x) $$
To differentiate \(\cos(2x)\) with respect to \(x\), we recognize it as a composite function where \( f(u) = \cos(u) \) and \( u = 2x \).
The derivative of \(\cos(u)\) is \(-\sin(u)\), and the derivative of \( u = 2x \) is simply \( u' = 2 \).
Applying the chain rule, we have:
$$ f'(x) = -\frac{1}{2} \times \big( -\sin(2x) \cdot 2 \big) $$
Multiplying the constants \(-\frac{1}{2}\) and 2, we get:
$$ f'(x) = \require{cancel} -\frac{1}{\cancel{2}} \times \cancel{2} \times \big( -\sin(2x) \big) $$
$$ f'(x) = -1 \times \big( -\sin(2x) \big) $$
$$ f'(x) = \sin(2x) $$
So, the derivative of \(-\frac{1}{2} \cos(2x)\) is \(\sin(2x)\).
Derivative Calculation - Example 4
In this example, we’re going to differentiate the function \(\arctan[\sin(x)]\):
$$ \frac{d}{dx} \arctan(\sin(x)) $$
This is a composite function where the outer function is \( f(u) = \arctan(u) \) and the inner function is \( u = \sin(x) \).
We’ll use the chain rule for differentiation:
$$ \frac{d}{dx} \arctan(\sin(x)) = \left[ \frac{d}{dx} \sin(x) \right] \times \frac{d}{du} \arctan(u) $$
The derivative of \(\sin(x)\) is \(\cos(x)\):
$$ \left[ \frac{d}{dx} \sin(x) \right] \times \frac{d}{du} \arctan(u) $$
$$ \cos(x) \times \frac{d}{du} \arctan(u) $$
The derivative of \(\arctan(u)\) is:
$$ \frac{d}{du} \arctan(u) = \frac{1}{1 + u^2} $$
Substituting this into our expression:
$$ \cos(x) \times \frac{1}{1 + u^2} $$
Replacing \( u \) with \(\sin(x)\) gives:
$$ \cos(x) \times \frac{1}{1 + \big(\sin(x)\big)^2} $$
Therefore, the final simplified derivative is:
$$ \frac{\cos(x)}{1 + \sin^2(x)} $$
Derivative Calculation - Example 5
In this example, we’re going to differentiate the following function:
\[ \frac{d}{dx} \left(-\ln(\cos(x))\right) \]
We’ll start by applying a fundamental property of derivatives: the derivative of a constant multiplied by a function equals the constant times the derivative of that function.
Thus, we can factor the \(-1\) outside the differentiation:
\[ -1 \cdot \frac{d}{dx} \left(\ln(\cos(x))\right) \]
\[ -\frac{d}{dx} \left(\ln(\cos(x))\right) \]
The derivative of the natural logarithm \(\ln(u(x))\) with respect to \(x\) is:
\[ \frac{1}{u(x)} \cdot \frac{du}{dx} \]
Here, \( u(x) = \cos(x) \).
So we have:
\[ -\frac{1}{\cos(x)} \times \frac{d}{dx} \big(\cos(x)\big) \]
The derivative of \(\cos(x)\) is \(-\sin(x)\):
\[ -\frac{1}{\cos(x)} \times \big(-\sin(x)\big) \]
Pulling out the negative sign gives:
\[ (-1) \times -\frac{1}{\cos(x)} \times \sin(x) \]
The two negatives cancel out, leaving:
\[ \frac{1}{\cos(x)} \times \sin(x) \]
\[ \frac{\sin(x)}{\cos(x)} \]
And since in trigonometry the ratio \(\sin(x)/\cos(x)\) is the tangent function \(\tan(x)\), we get:
\[ \tan(x) \]
Therefore, the final result of the derivative is:
\[ \frac{d}{dx} \left(-\ln(\cos(x))\right) = \tan(x) \]
Derivative Calculation - Example 6
In this example, we’ll differentiate the function \( 2e^{\sqrt{x}} \) with respect to \( x \).
$$ \frac{d}{dx} \left( 2e^{\sqrt{x}} \right) $$
Since 2 is a constant factor, we can factor it outside the differentiation operator.
Applying the rule for differentiating a constant multiple of a function, we get:
$$ 2 \times \frac{d}{dx} \left( e^{\sqrt{x}} \right) $$
The derivative of the exponential function \( e^{u(x)} \) involves the chain rule:
$$ 2 \times \frac{d}{d u} e^{u} \times \frac{d}{dx} u $$
$$ 2 \times \frac{d}{d u} e^{u} \times \frac{d}{dx} \left( \sqrt{x} \right) $$
The derivative of the exponential function is simply \( \frac{d}{d u} e^{u} = e^{u} \), so we have:
$$ 2 \times e^{\sqrt{x}} \times \frac{d}{dx} \left( \sqrt{x} \right) $$
The derivative of the square root function is:
$$ \frac{d}{dx} \left( \sqrt{x} \right) = \frac{1}{2\sqrt{x}} $$
Thus:
$$ 2 \times e^{\sqrt{x}} \times \frac{1}{2\sqrt{x}} $$
Simplifying the constants gives:
$$ \require{cancel} \cancel{2} \times e^{\sqrt{x}} \times \frac{1}{\cancel{2} \sqrt{x}} $$
$$ e^{\sqrt{x}} \times \frac{1}{\sqrt{x}} $$
Therefore, the derivative of \( 2e^{\sqrt{x}} \) with respect to \( x \) is:
$$ \frac{d}{dx} \left( 2e^{\sqrt{x}} \right) = \frac{e^{\sqrt{x}}}{\sqrt{x}} $$
Derivative Calculation - Example 7
In this example, we’re going to find the derivative of the function \(-\ln(1 + \cos^2(x))\):
$$ \frac{d}{dx} \left( -\ln(1 + \cos^2(x)) \right) $$
First, we apply the constant multiple rule, which tells us that \((k \cdot f)' = k \cdot f'\). So we factor the negative sign outside the derivative:
$$ \frac{d}{dx} \left( -1 \cdot \ln(1 + \cos^2(x)) \right) $$
$$ -1 \cdot \frac{d}{dx} \left( \ln(1 + \cos^2(x)) \right) $$
$$ - \frac{d}{dx} \ln(1 + \cos^2(x)) $$
This derivative involves a composite function of the form \( f(u(x)) \).
$$ \frac{d}{dx} \big( f(u(x)) \big ) = f'(u(x)) \cdot u'(x) $$
Here, the outer function is \( f(u) = \ln(u) \), and the inner function is \( u(x) = 1 + \cos^2(x) \).
Applying the chain rule, we differentiate the logarithm and multiply it by the derivative of its inner function:
The derivative of the natural logarithm \(\ln(u)\) is \(\frac{1}{u}\), multiplied by the derivative of \(u\). In this case, \( u = 1 + \cos^2(x) \).
$$ - \frac{d}{dx} \ln(1 + \cos^2(x)) = - \left( \frac{d}{du} \ln(u) \cdot \frac{d}{dx} \big(1 + \cos^2(x)\big) \right) $$
$$ - \frac{d}{dx} \ln(1 + \cos^2(x)) = - \left( \frac{1}{u} \cdot \frac{d}{dx} \big(1 + \cos^2(x)\big) \right) $$
$$ - \frac{d}{dx} \ln(1 + \cos^2(x)) = - \left( \frac{1}{1 + \cos^2(x)} \cdot \frac{d}{dx} \big(1 + \cos^2(x)\big) \right) $$
Next, we differentiate the inner function \( 1 + \cos^2(x) \).
Since the derivative of a sum is simply the sum of the derivatives:
$$ - \frac{d}{dx} \ln(1 + \cos^2(x)) = - \left( \frac{1}{1 + \cos^2(x)} \cdot \left[ \frac{d}{dx}(1) + \frac{d}{dx} \cos^2(x) \right] \right) $$
The derivative of the constant 1 is zero, and the derivative of \(\cos^2(x)\) is \( 2 \cos(x) \cdot (-\sin(x)) \):
$$ - \frac{d}{dx} \ln(1 + \cos^2(x)) = - \left( \frac{1}{1 + \cos^2(x)} \cdot \big[ 0 + 2 \cos(x) \cdot (-\sin(x)) \big] \right) $$
$$ - \left( \frac{1}{1 + \cos^2(x)} \cdot \big[ -2 \cos(x) \sin(x) \big] \right) $$
$$ \frac{2 \cos(x) \sin(x)}{1 + \cos^2(x)} $$
Using the trigonometric identity \( 2 \cos(x) \sin(x) = \sin(2x) \), we can simplify the numerator:
$$ \frac{\sin(2x)}{1 + \cos^2(x)} $$
Therefore, the derivative of the function is:
$$ \frac{d}{dx} \left( -\ln(1 + \cos^2(x)) \right) = \frac{\sin(2x)}{1 + \cos^2(x)} $$
These steps clearly show how to arrive at the final result of this derivative.
Derivative Calculation - Example 8
In this example, we’ll find the derivative of the function \( \frac{1}{\cos(x)} \):
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right) $$
There are several different ways to solve this derivative. Let’s explore three approaches.
Solution 1
First, we can rewrite the function as a negative exponent:
$$ \frac{1}{\cos(x)} = \cos(x)^{-1} $$
$$ \frac{d}{dx} \big( \cos(x)^{-1} \big ) $$
We differentiate \(\cos(x)^{-1}\) using the chain rule:
$$ \frac{d}{dx} \big( \cos(x)^{-1} \big ) = (-1) \cdot \cos(x)^{-2} \cdot \frac{d}{dx} \cos(x) $$
We differentiate the outer function, lowering the exponent by one, and multiply it by the derivative of the inner function, \(\cos(x)\).
Since the derivative of \(\cos(x)\) is \(-\sin(x)\), we substitute this to get:
$$ \frac{d}{dx} \big( \cos(x)^{-1} \big ) = (-1) \cdot \cos(x)^{-2} \cdot \big( -\sin(x) \big ) $$
$$ \frac{d}{dx} \big( \cos(x)^{-1} \big ) = \frac{\sin(x)}{\cos^2(x)} $$
We can simplify this further, knowing that:
$$ \frac{\sin(x)}{\cos^2(x)} = \tan(x) \cdot \frac{1}{\cos(x)} $$
Therefore, the derivative can also be written as:
$$ \frac{d}{dx} \left( \cos(x)^{-1} \right ) = \frac{\tan(x)}{\cos(x)} $$
This is one possible way to evaluate this derivative.
Solution 2
Another method is to recognize that \( \frac{1}{\cos(x)} \) is simply the secant function:
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) $$
Therefore, the function is:
$$ f(x) = \sec(x) $$
We know the standard derivative of the secant function:
$$ \frac{d}{dx} \sec(x) = \sec(x) \tan(x) $$
So we can write directly:
$$ \frac{d}{dx} \sec(x) = \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) $$
$$ \frac{d}{dx} \sec(x) = \sec(x) \tan(x) $$
$$ \frac{d}{dx} \sec(x) = \frac{1}{\cos(x)} \cdot \tan(x) $$
$$ \frac{d}{dx} \sec(x) = \frac{\tan(x)}{\cos(x)} $$
Solution 3
A third approach is to treat the original function as a quotient:
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) $$
Applying the quotient rule, we get:
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) = \frac{0 \cdot \cos(x) - 1 \cdot \big( -\sin(x) \big )}{\cos^2(x)} $$
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) = \frac{\sin(x)}{\cos^2(x)} $$
Once again, this result can be rewritten as \( \tan(x) \cdot \sec(x) \):
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) = \frac{\sin(x)}{\cos(x)} \cdot \frac{1}{\cos(x)} $$
Since \(\frac{\sin(x)}{\cos(x)} = \tan(x)\), we have:
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) = \tan(x) \cdot \frac{1}{\cos(x)} $$
All approaches lead to the same result:
$$ \frac{d}{dx} \left( \frac{1}{\cos(x)} \right ) = \frac{\tan(x)}{\cos(x)} $$
This illustrates how various differentiation techniques converge to the same consistent answer, underscoring the robustness of calculus methods.
