Why Repeated Derivatives Have Patterns
A second derivative is the derivative of a derivative; a third derivative is the derivative of the second derivative, and the process can continue. For some familiar functions, this process produces a pattern that repeats or follows a simple formula. Recognizing that pattern is more efficient—and more reliable—than starting every calculation from scratch.
This tutorial focuses on sine, cosine, the natural exponential, and logarithms. The notation \(f^{(n)}(x)\) means the \(n\)th derivative of \(f\), with \(f^{(0)}(x)=f(x)\). In particular, \(f^{(2)}=f''\) and \(f^{(3)}=f'''\). The superscript in \(f^{(n)}\) counts differentiations; it does not mean that the function is raised to a power.
The Four-Step Cycle for Sine and Cosine
Differentiate sine and cosine repeatedly, using the usual derivatives \(\frac{d}{dx}\sin x=\cos x\) and \(\frac{d}{dx}\cos x=-\sin x\). The resulting sequences are:
Each sequence returns to its starting function after four differentiations. Thus the derivative depends only on the remainder when \(n\) is divided by \(4\). Equivalently, the pattern can be written as a phase shift:
Here \(\frac{d^n}{dx^n}\) denotes taking \(n\) derivatives. The phase-shift formulas agree with the four-step sequences: increasing \(n\) by one shifts the angle by \(\frac{\pi}{2}\), while increasing it by four shifts the angle by \(2\pi\), which leaves sine and cosine unchanged.
Why the Trigonometric Formulas Work
A short induction verifies the sine formula. For \(n=0\), its right-hand side is \(\sin x\), the original function. Suppose the \(n\)th derivative is \(\sin(x+n\pi/2)\). Differentiating that expression gives \(\cos(x+n\pi/2)\). Since \(\cos u=\sin(u+\pi/2)\), the result is \(\sin(x+(n+1)\pi/2)\), which is the claimed formula for the next derivative.
For cosine, the base case \(n=0\) gives \(\cos x\). If its \(n\)th derivative is \(\cos(x+n\pi/2)\), differentiating gives \(-\sin(x+n\pi/2)\). The identity \(-\sin u=\cos(u+\pi/2)\) makes this \(\cos(x+(n+1)\pi/2)\). Thus both formulas hold for every nonnegative integer \(n\). This argument explains why the same four-step pattern continues, rather than merely listing the first few derivatives.
Worked Example: Find the Seventh Derivative of Sine
Find \(\frac{d^7}{dx^7}\sin x\) by following the cycle, then check the result by differentiating it once.
Start with the function and differentiate in order:
The phase-shift formula gives the same result:
For the check, differentiate the proposed seventh derivative: \(\frac{d}{dx}(-\cos x)=\sin x\). This is \(f^{(8)}(x)\), and the cycle also gives \(f^{(8)}(x)=\sin x\), as required.
The Natural Exponential
The natural exponential function is \(e^x\), where \(e\) is the base of the natural logarithm. Its defining derivative property is especially simple: \(\frac{d}{dx}e^x=e^x\). Because each differentiation gives back the same function, no cycle is needed.
The result follows by induction as well. For \(n=0\), the expression is \(e^x\). If the \(n\)th derivative is \(e^x\), its derivative is again \(e^x\), proving the formula for \(n+1\).
Worked Example: Find the Sixth Derivative of \(e^x\)
Let \(f(x)=e^x\). Repeatedly applying \(\frac{d}{dx}e^x=e^x\) gives:
Therefore \(f^{(6)}(x)=e^x\). To check, differentiate the answer: \(\frac{d}{dx}e^x=e^x\), which is \(f^{(7)}(x)\), consistent with the same rule. At \(x=0\), \(f^{(6)}(0)=e^0=1\).
Repeated Derivatives of Logarithms
The natural logarithm \(\ln x\) is defined only for \(x>0\). Its first derivative is \(\frac{d}{dx}\ln x=\frac{1}{x}\), so subsequent derivatives differentiate reciprocal powers. The first few are:
The signs alternate, the power of \(x\) increases, and the numerator is a factorial. For every integer \(n\geq 1\):
The domain condition matters: \(\ln x\) and all its derivatives in this formula are being considered for positive \(x\). The factorial is \((n-1)!\), not \(n!\). For example, \(0!=1\), so the formula for \(n=1\) gives \(1/x\), as it should.
Deriving the Logarithm Formula
The formula follows by induction. For \(n=1\), its right-hand side is \((-1)^0(0!)/x=1/x\), which is the derivative of \(\ln x\). Now suppose it holds for some \(n\geq1\). Differentiating the assumed expression gives:
This is the claimed formula with \(n+1\) in place of \(n\). Since the base case is true and each case implies the next, the formula holds for every integer \(n\geq1\). Throughout, \(x>0\), so \(\ln x\) is defined.
Worked Example: Find the Fourth Derivative of \(\ln(x-2)\)
First determine the domain. The logarithm requires \(x-2>0\), so the function is defined only when \(x>2\). Set \(u=x-2\); then \(du/dx=1\), and successive differentiation gives:
The general formula also gives this result: the fourth derivative of \(\ln u\) is \(-6/u^4\), and \(du/dx=1\), so substituting \(u=x-2\) yields \(-6/(x-2)^4\). The domain remains \(x>2\). As a check, differentiating the proposed fourth derivative gives \(24/(x-2)^5\), the fifth derivative obtained by continuing the pattern.
Logarithms with Other Bases and Domains
For a base \(b>0\), \(b\ne1\), the logarithm \(\log_b x\) is defined for \(x>0\) and can be written as \(\ln x/\ln b\). Since \(\ln b\) is a constant, it stays as a factor through every differentiation. Thus, for \(n\geq1\):
Worked Example: Find the Third Derivative of \(\log_2 x\)
The domain is \(x>0\). Rewrite using the natural logarithm, keeping the constant factor:
Differentiate three times:
The general formula confirms the result: with \(n=3\), the numerator is \((-1)^2 2!=2\), giving \(2/(x^3\ln2)\). Differentiating that answer yields \(-6/(x^4\ln2)\), the fourth derivative, so the signs and factorial pattern continue correctly. The domain is still \(x>0\).
A Common Mistake: Losing the Sign or the Domain
A common error is to remember that the numerator involves a factorial but to use the wrong one or omit the alternating sign. For example, applying the incorrect rule \(\frac{d^n}{dx^n}\ln x=n!/x^n\) at \(n=2\) would give \(2/x^2\). But differentiating \(\ln x\) twice gives:
The corrected general formula uses \((-1)^{n-1}(n-1)!\), which gives \(-1/x^2\) when \(n=2\). A separate error is to ignore the logarithm's domain. For \(\ln(x-2)\), writing a derivative formula for all real \(x\) is not valid: the original function exists only for \(x>2\). Keep the original domain in view as you differentiate.
Why These Patterns Are Useful
Higher derivatives describe how a function's rates of change themselves vary. The recurring forms here make many derivative calculations predictable: sine and cosine repeat every four differentiations, the natural exponential remains unchanged, and logarithmic derivatives have a systematic sign, power, and factorial pattern. These results are useful both for exact symbolic work and for checking calculations.
A good routine is to identify the function and its domain first, write successive derivatives until the pattern is clear, and then use the general formula if the derivative order is large. For sine and cosine, reducing \(n\) modulo \(4\) quickly identifies the correct cycle entry. For logarithms, checking the first two derivatives is an effective way to catch a missing negative sign or an incorrect factorial.
Check Your Understanding
Use the derivative patterns and state any domain restriction that applies.
- Find the fifth derivative of \(\cos x\).
- Find the ninth derivative of \(e^x\).
- Find the third derivative of \(\ln x\), and state its domain.
- Find the second derivative of \(\ln(x+4)\), and state the domain of the original function.
- Explain why the numerator in the \(n\)th derivative of \(\ln x\) is \((n-1)!\), rather than \(n!\).