Skip to content

Derivative

Definition of the Derivative at a General Point \( x \)

We have defined the derivative at a specific point \( x = c \) as

\[ f'(c) = \lim_{x \to c} \frac{f(x) - f(c)}{x - c}. \]

Now, we rewrite the derivative of a function \( f(x) \) at a general point \( x \). Rememeber that we are doing nothing new, neither it is a new definition, it is just we are writing derivative at a general point \(x\) instead of a specific point \(c\).

Consider a fixed point \( P(x, f(x)) \) on the graph of \( y = f(x) \). In a neighborhood of \( x \), take another point \( x + h \), where:

  • If \( h > 0 \), then \( x + h \) lies on the right of \( x \).
  • If \( h < 0 \), then \( x + h \) lies on the left of \( x \).

The corresponding point on the graph is

\[ Q(x + h, f(x + h)). \]

The line segment PQ is a secant to the curve, and its slope is given by

\[ \text{Slope of PQ} = \frac{f(x + h) - f(x)}{(x + h) - x} = \frac{f(x + h) - f(x)}{h}. \]

Now, as \( h \to 0 \), the point \( Q \) moves closer to \( P \), and the secant approaches a tangent line at \( P(x, f(x)) \). The limiting value of the secant slope, if it exists, gives the slope of the tangent line, which we define as the derivative:

\[ f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}. \]

Thus, the derivative \( f'(x) \) represents the slope of the tangent to the curve at the point \( P(x, f(x)) \), provided the limit exists.

alt text

Example

Let us find the derivative of \( f(x) = x^2 \) at a general point \( x \) on it. By definition,

\[ f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} \]

Substituting \( f(x) = x^2 \),

\[ f'(x) = \lim_{h \to 0} \frac{(x+h)^2 - x^2}{h} = \lim_{h \to 0} \frac{x^2 + 2xh + h^2 - x^2}{h} = \lim_{h \to 0} \frac{2xh + h^2}{h} \]

Canceling \( h \),

\[ f'(x) = \lim_{h \to 0} (2x + h) \]

Taking the limit,

\[ f'(x) = 2x \]

Thus, the slope of the tangent to the curve at any point \( (x, f(x)) \) is \( 2x \). For example, at \( x = \frac{1}{2} \),

\[ f'\left(\frac{1}{2}\right) = 2 \times \frac{1}{2} = 1 \]

This means the tangent at \( \left(\frac{1}{2}, \frac{1}{4}\right) \) has slope \( 1 \). If this tangent makes an angle \( \theta \) with the positive \( x \)-axis, then

\[ \tan \theta = 1 \]

implying \( \theta = 45^\circ \).

At \( x = 2 \), the slope of the tangent is

\[ f'(2) = 2 \times 2 = 4 \]

If this tangent makes an angle \( \alpha \) with the positive \( x \)-axis, then

\[ \tan \alpha = 4 \]

which gives the inclination of the tangent at \( (2,4) \).

alt text

Example

Let us find the derivative of \( f(x) = \sin x \) at a general point \( x \) using the definition:

\[ f'(x) = \lim_{h \to 0} \frac{\sin (x+h) - \sin x}{h} \]

Using the identity,

\[ \sin (x+h) - \sin x = 2 \cos \left( x + \frac{h}{2} \right) \sin \frac{h}{2} \]

we rewrite the difference quotient as

\[ f'(x) = \lim_{h \to 0} \frac{2 \cos \left( x + \frac{h}{2} \right) \sin \frac{h}{2}}{h} \]

Rewriting the fraction,

\[ f'(x) = \lim_{h \to 0} 2 \cos \left( x + \frac{h}{2} \right) \cdot \frac{\sin \frac{h}{2}}{h} \]

Since

\[ \lim_{h \to 0} \frac{\sin \frac{h}{2}}{h} = \frac{1}{2} \lim_{h \to 0} \frac{\sin \frac{h}{2}}{\frac{h}{2}} = \frac{1}{2} \cdot 1 = \frac{1}{2} \]

we obtain

\[ f'(x) = \cos x \]

Thus, the derivative of \( f(x) = \sin x \) is \( f'(x) = \cos x \).

That means at \( x = \frac{\pi}{3} \), the slope of the tangent to the curve \( y = \sin x \) is

\[ f'\left(\frac{\pi}{3}\right) = \cos \frac{\pi}{3} = \frac{1}{2} \]

If this tangent makes an angle \( \theta \) with the positive \( x \)-axis, then

\[ \tan \theta = \frac{1}{2} \]

which implies

\[ \theta = \tan^{-1} \frac{1}{2} \]

Similarly, at \( x = \frac{\pi}{4} \), the slope of the tangent is

\[ f'\left(\frac{\pi}{4}\right) = \cos \frac{\pi}{4} = \frac{\sqrt{2}}{2} \]

which means if this tangent makes an angle \( \alpha \) with the positive \( x \)-axis, then

\[ \tan \alpha = \frac{\sqrt{2}}{2} \]

so that

\[ \alpha = \tan^{-1} \frac{\sqrt{2}}{2} \]

At \( x = \pi \),

\[ f'(\pi) = \cos \pi = -1 \]

Thus, the tangent at \( (\pi, 0) \) has slope \( -1 \), meaning the tangent line makes an angle \( 135^\circ \) with the positive \( x \)-axis, since

\[ \tan 135^\circ = -1 \]

This confirms that the slope of the tangent line to the curve \( y = \sin x \) varies as \( \cos x \), controlling the steepness and inclination at different points.

Example

Let us find the derivative of \( f(x) = e^x \) at a general point \( x \) using the definition:

\[ f'(x) = \lim_{h \to 0} \frac{e^{x+h} - e^x}{h} \]

Rewriting the numerator,

\[ e^{x+h} - e^x = e^x e^h - e^x = e^x (e^h - 1) \]

we obtain

\[ f'(x) = \lim_{h \to 0} e^x \cdot \frac{e^h - 1}{h} \]

Since the limit

\[ \lim_{h \to 0} \frac{e^h - 1}{h} = 1 \]

is a fundamental result, we conclude that

\[ f'(x) = e^x \]

Thus, the derivative of \( f(x) = e^x \) is \( f'(x) = e^x \), meaning the slope of the tangent at any point \( (x, e^x) \) is exactly \( e^x \), the function value itself.

For example, at \( x = 0 \),

\[ f'(0) = e^0 = 1 \]

so the tangent line at \( (0,1) \) has slope \( 1 \), making an angle \( 45^\circ \) with the positive \( x \)-axis since

\[ \tan 45^\circ = 1 \]

alt text

We have seen that the derivative of a function \( f(x) \) at a point \( x \) is defined as the limit

\[ \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} \]

whenever this limit exists. This definition provides a direct way to compute derivatives by evaluating the difference quotient and taking the limit as \( h \to 0 \). We call this process of calculating derivatives as differentiation.

However, as the complexity of \( f(x) \) increases, evaluating this limit directly for every function becomes increasingly difficult. Functions such as polynomials, trigonometric expressions, exponential functions, and logarithmic functions all require distinct algebraic manipulations to simplify the difference quotient before taking the limit. While we have successfully applied the definition to simple functions like \( f(x) = x^2 \), \( f(x) = \sin x \), and \( f(x) = e^x \), performing such calculations repeatedly for every new function is impractical.

To address this challenge, we adopt a structured approach. First, we compute the derivatives of a small set of elementary functions—such as polynomials, exponentials, and trigonometric functions—using the definition. These results serve as fundamental building blocks. Next, we develop an algebra of derivatives, which consists of general rules that allow us to compute the derivative of more complex functions without repeatedly applying the limit definition.

For example, if we know the derivatives of \( f(x) \) and \( g(x) \), we derive rules for the derivative of their sum, product, and quotient. Furthermore, we establish methods for differentiating composite functions, leading to powerful techniques such as the chain rule.

Thus, differentiation—the process of computing derivatives—becomes a systematic procedure rather than an exercise in limit evaluation for each function individually. By combining known derivative formulas with the rules of differentiation, we can efficiently compute the derivative of any function encountered in calculus.

In the next chapter, we develop these differentiation rules rigorously, ensuring that we can compute derivatives for a wide class of functions with precision and efficiency.

Calculating LHD and RHD using LHL and RHL of derivative of the function

The right-hand derivative (RHD) of \( f(x) \) at \( x = c \) is defined as

\[ \lim_{x \to c^+} \frac{f(x) - f(c)}{x - c} \]

Similarly, the left-hand derivative (LHD) at \( x = c \) is

\[ \lim_{x \to c^-} \frac{f(x) - f(c)}{x - c} \]

Both these limits take the indeterminate form \( \frac{0}{0} \) when \( f(x) \) is differentiable at \( x \). We can evaluate these rules using L'Hôpital's Rule. But to evaluate them like this, the conditions of L'Hôpital's Rule must be satisfied:

  1. \( f(x) \) must be differentiable in an open interval containing \( c \) (except possibly at \( x = c \)).

  2. The limit

    \[ \lim_{x \to c^+} f'(x) \]

    must be finite or \( \pm\infty \), and similarly,

    \[ \lim_{x \to c^-} f'(x) \]

    must be finite or \( \pm\infty \).

If either or both these limits do not exist, then we cannot conclude anything.

Applying L'Hôpital's Rule,

\[ \lim_{x \to c^+} \frac{f(x) - f(c)}{x - c} = \lim_{x \to c^+} f'(x), \]

and

\[ \lim_{x \to c^-} \frac{f(x) - f(c)}{x - c} = \lim_{x \to c^-} f'(x). \]

Thus, the right-hand derivative at \( x = c \) is given by the right-hand limit of \( f'(x) \), and the left-hand derivative is given by the left-hand limit of \( f'(x) \). If these two limits exist and are equal, then \( f(x) \) is differentiable at \( x = c \), and its derivative is

\[ f'(c) = \lim_{x \to c} f'(x). \]

If the left-hand and right-hand derivatives do not agree, the function is not differentiable at \( x = c \).

Geometrically, the right-hand derivative (RHD) at a point \( x = c \) is computed by taking a point \( x \) near \( c \) on its right side and considering the slope of the secant line joining \( (c, f(c)) \) and \( (x, f(x)) \). Mathematically, this is given by

\[ \frac{f(x) - f(c)}{x - c}. \]

As \( x \to c^+ \), this secant line approaches the tangent line at \( (c, f(c)) \), and its slope approaches the RHD,

\[ \lim_{x \to c^+} \frac{f(x) - f(c)}{x - c}. \]

Now, instead of considering secant lines, suppose we draw a tangent line at \( (x, f(x)) \) for each point \( x \) near \( c \) on the right. Each of these tangents has a slope given by \( f'(x) \), and as \( x \to c^+ \), these tangent lines approach the tangent line at \( (c, f(c)) \). Consequently, the slopes of these tangents approach the slope of the final tangent at \( (c, f(c)) \). This means that

\[ \lim_{x \to c^+} f'(x) = \lim_{x \to c^+} \frac{f(x) - f(c)}{x - c}, \]

establishing that the right-hand derivative is equal to the right-hand limit of \( f'(x) \).

alt text

A completely analogous argument holds for the left-hand derivative (LHD), where we consider points \( x \) near \( c \) on the left and analyze the corresponding secant and tangent lines. Thus,

\[ \lim_{x \to c^-} f'(x) = \lim_{x \to c^-} \frac{f(x) - f(c)}{x - c}. \]

This geometric interpretation confirms that differentiation is a limiting process where both secant approximations and local tangent behavior lead to the same fundamental conclusion.

Continuity of Derivative

When

\[ \lim_{x \to c^+} f'(x) = \lim_{x \to c^-} f'(x) = L \]

in \( \mathbb{R} \), it follows that the left-hand derivative and right-hand derivative of \( f(x) \) at \( x = c \) are equal. This implies that \( f(x) \) is differentiable at \( x = c \), and

\[ f'(c) = L. \quad \text{[By Definition]} \]

By the definition of continuity, a function \( g(x) \) is continuous at \( x = c \) if

\[ \lim_{x \to c} g(x) = g(c). \]

Applying this to \( f'(x) \), we conclude that \( f'(x) \) is continuous at \( x = c \). This shows that when the left-hand limit and right-hand limit of \( f'(x) \) exist and are equal, then \( f'(x) \) must be continuous at \( x = c \).

Now, in many situations, we do not need to calculate the left-hand derivative (LHD) and right-hand derivative (RHD) using original definitions directly. Instead, we can use derivatives. So we first differentiate the function (wherever possible) and then evaluate the left-hand limit (LHL) and right-hand limit (RHL) of the derivative function to obtain the LHD and RHD.

Consider the function

\[ f(x) = \begin{cases} x^2 - 1, & x < 1, \\ 1 - x^3, & x \geq 1. \end{cases} \]

We want to find \( \text{LHD} \) and \( \text{RHD} \) at \( x = 1 \). Using the original definitions of LHD and RHD, we could compute

\[ \lim_{x \to 1^-} \frac{f(x) - f(1)}{x - 1}, \quad \lim_{x \to 1^+} \frac{f(x) - f(1)}{x - 1}. \]

However, instead of proceeding this way, we first differentiate \( f(x) \) in its respective domains. We obtain

\[ f'(x) = \begin{cases} 2x, & x < 1, \\ -3x^2, & x > 1. \end{cases} \]

We remove the equality at \( x = 1 \) because we do not yet know whether \( f(x) \) is differentiable at \( x = 1 \). Now, we compute the left-hand limit (LHL) and right-hand limit (RHL) of \( f'(x) \) at \( x = 1 \):

\[ \lim_{x \to 1^-} f'(x) = \lim_{x \to 1^-} 2x = 2. \]
\[ \lim_{x \to 1^+} f'(x) = \lim_{x \to 1^+} -3x^2 = -3. \]

Since the left-hand limit of \( f'(x) \) equals the left-hand derivative of \( f(x) \), and the right-hand limit of \( f'(x) \) equals the right-hand derivative of \( f(x) \), we conclude:

\[ \text{LHD} = 2, \quad \text{RHD} = -3. \]

Since \( \text{LHD} \neq \text{RHD} \), \( f(x) \) is not differentiable at \( x = 1 \), and we do not put an equality sign in the definition of \( f'(1) \) because \( f'(1) \) does not exist.

This approach provides a convenient way to check differentiability at a point by first computing the derivative where it exists and then evaluating its left-hand and right-hand limits.


Consider another example:

\[ f(x) = \begin{cases} x^2, & x \geq 1, \\ 2x - 1, & x < 1. \end{cases} \]

We first check continuity at \( x = 1 \). Evaluating the left-hand and right-hand limits:

\[ \lim_{x \to 1^-} f(x) = \lim_{x \to 1^-} (2x - 1) = 2(1) - 1 = 1, \]
\[ \lim_{x \to 1^+} f(x) = \lim_{x \to 1^+} x^2 = 1^2 = 1. \]

Since both limits equal \( f(1) = 1 \), the function is continuous at \( x = 1 \).

Now, we check differentiability at \( x = 1 \). Differentiating \( f(x) \) in its respective domains:

\[ f'(x) = \begin{cases} 2x, & x > 1, \\ 2, & x < 1. \end{cases} \]

Since we do not yet know whether \( f(x) \) is differentiable at \( x = 1 \), we remove the equal sign at \( x = 1 \). Now, we compute the left-hand and right-hand limits of \( f'(x) \) at \( x = 1 \):

\[ \lim_{x \to 1^-} f'(x) = \lim_{x \to 1^-} 2 = 2, \]
\[ \lim_{x \to 1^+} f'(x) = \lim_{x \to 1^+} 2x = 2(1) = 2. \]

Since both limits are equal, \( f(x) \) is differentiable at \( x = 1 \), and we can now write

\[ f'(1) = 2. \]

Thus, the derivative exists at \( x = 1 \), and we can now include the equality sign in \( f'(x) \), giving

\[ f'(x) = \begin{cases} 2x, & x > 1, \\ 2, & x \leq 1. \end{cases} \]

This confirms that \( f(x) \) is differentiable at \( x = 1 \), and its derivative is continuous there.


Discontinuous Derivative

We know that if a function \( f(x) \) is differentiable at \( x = c \), then it must be continuous at \( x = c \).

Now, consider this question:

If \( f(x) \) is continuous, is its derivative \( f'(x) \) necessarily continuous?

A simple counterexample shows that the answer in 'No'. Consider \( f(x) = |x| \), which is a continuous function. However, it is not differentiable at \( x = 0 \), and for \( x > 0 \),

\[ f'(x) = 1, \quad \text{while for } x < 0, \quad f'(x) = -1. \]

Thus, \( f'(x) \) has a missing point discontinuity at \( x = 0 \). The function \( f(x) = |x| \) is continuous, but its derivative is discontinuous at \( x = 0 \).

Now, consider a more subtle question:

Can \( f(x) \) be differentiable at all points but still have a discontinuous derivative \( f'(x) \)?

Yes. A classical example is

\[ f(x) = \begin{cases} x^2 \sin(1/x), & x \neq 0, \\ 0, & x = 0. \end{cases} \]

We know that this function is continuous for all \( x \in \mathbb{R} \).

Because it is just product of polynomial and trigonometric fucntion it is always differentiable for all \(x\ne 0\). Next, we check differentiability at \( x = 0 \). The left-hand derivative is

\[ \lim_{x \to 0^-} \frac{f(x) - f(0)}{x - 0} = \lim_{x \to 0^-} \frac{x^2 \sin(1/x)}{x} = \lim_{x \to 0^-} x \sin(1/x) = 0. \]

Similarly, the right-hand derivative is

\[ \lim_{x \to 0^+} \frac{f(x) - f(0)}{x - 0} = \lim_{x \to 0^+} x \sin(1/x) = 0. \]

Thus, \( f(x) \) is differentiable at \( x = 0 \), and

\[ f'(0) = 0. \]

So we can conclude that for this fucntion the derivative exists at all points \(\mathbb{R}\).

But is \(f'(x)\) continuous for \(x\in \mathbb{R}\)? Let us check.

For \( x \neq 0 \), differentiating \( f(x) = x^2 \sin(1/x) \) using the product rule gives

\[ f'(x) = 2x \sin(1/x) - \cos(1/x). \]

This function is clearly continuous for all \(x\ne 0\). But for \(x=0\) we still need to check.

To check whether \( f'(x) \) is continuous at \( x = 0 \), we need to prove that \(\lim_{x \to 0} f'(x) = f'(0)\). So we evalaute,

\[ \lim_{x \to 0} f'(x) = \lim_{x \to 0} (2x \sin(1/x) - \cos(1/x)). \]

Since \( 2x \sin(1/x) \to 0 \) as \( x \to 0 \), the behavior of \( f'(x) \) near \( x = 0 \) is dominated by the term \( -\cos(1/x) \), which oscillates between -1 and 1 without settling to a single value. Thus,

\[ \lim_{x \to 0} f'(x) \quad \text{does not exist}. \]

Since \( \lim_{x \to 0} f'(x) \) does not exist, \( f'(x) \) is discontinuous at \( x = 0 \), even though \( f(x) \) is differentiable at all points in \( \mathbb{R} \).

This example demonstrates that a function can be differentiable everywhere, yet its derivative can be discontinuous.

Such a strange behavior at \( x = 0 \) can be understood geometrically.

Consider the right-hand derivative (RHD). To compute the RHD, we take a point \( x \) in the right neighborhood of \( 0 \) and draw a secant line joining \( (0,0) \) and \( (x, x^2 \sin(1/x)) \). As \( x \to 0^+ \), the function \( x^2 \sin(1/x) \) oscillates due to the \(\sin(1/x)\) term, but since it is multiplied by \( x^2 \), the amplitude of oscillation shrinks, and the secant line still approaches the horizontal axis. This implies that the slope of the secant tends to zero, confirming that

\[ \lim_{x \to 0^+} \frac{f(x) - f(0)}{x - 0} = 0. \]

Thus, the RHD exists and equals zero. A similar argument holds for the left-hand derivative (LHD), meaning that \( f(x) \) is differentiable at \( x = 0 \) with \( f'(0) = 0 \).

However, when examining the derivative function \( f'(x) \) itself, we must look at the slope of the tangent line at \( (x, f(x)) \). At each point \( x \neq 0 \), the tangent line has slope

\[ f'(x) = 2x \sin(1/x) - \cos(1/x). \]

Unlike the secant lines, the tangent lines do not settle to a limiting slope as \( x \to 0^+ \). Instead, the term \( -\cos(1/x) \) causes the slope to oscillate rapidly between \( -1 \) and \( 1 \), never converging to a single value. Thus,

\[ \lim_{x \to 0^+} f'(x) \quad \text{does not exist}. \]

alt text

This explains why \( f(x) \) is differentiable at \( x = 0 \), but \( f'(x) \) is discontinuous at \( x = 0 \). While the secant lines approach a well-defined limit (the horizontal axis), the slopes of the tangent lines never stabilize, leading to a failure of continuity in \( f'(x) \).

Darboux's Theorem

The example \( f(x) = x^2 \sin(1/x) \) demonstrates that a function can be differentiable at all points but still have a discontinuous derivative. This naturally leads to the question: How can the derivative of a function behave when it is discontinuous?

A fundamental result, Darboux's Theorem, provides a crucial insight into this question. It states that if a function \( f(x) \) is differentiable on an interval \( [a, b] \), then its derivative \( f'(x) \) satisfies the intermediate value property. That is, if \( f'(a) \) and \( f'(b) \) take two different values, then for any \( k \) between \( f'(a) \) and \( f'(b) \), there exists some \( c \in (a, b) \) such that

\[ f'(c) = k. \]

This means that although \( f'(x) \) may be discontinuous, it cannot have a jump discontinuity. Any discontinuity in \( f'(x) \) must be of the oscillatory type, where \( f'(x) \) fluctuates infinitely near some point rather than making a sudden jump.

The derivative \( f'(x) \) represents the slope of the tangent line to the curve \( y = f(x) \). Geometrically, Darboux’s theorem tells us that the slope of the tangent line cannot change abruptly. Instead, it must take all intermediate slopes between its values at two given points. Consider a function \( f(x) \) that is differentiable on an interval \( [a, b] \). At \( x = a \), the tangent line has some slope \( f'(a) \), and at \( x = b \), the tangent line has a different slope \( f'(b) \). The theorem asserts that as we move from \( x = a \) to \( x = b \), the slope must pass through every intermediate value between \( f'(a) \) and \( f'(b) \).

While Darboux’s theorem prevents jump discontinuities, it does not guarantee that \( f'(x) \) is continuous. The derivative can still be discontinuous in an oscillatory manner. This happens when the slope fluctuates infinitely fast, preventing the limit from settling to a single value. The function

\[ f(x) = x^2 \sin(1/x), \quad x \neq 0, \quad f(0) = 0 \]

is a perfect example. It is differentiable everywhere, but its derivative

\[ f'(x) = 2x \sin(1/x) - \cos(1/x) \]

oscillates indefinitely near \( x = 0 \), making \( f'(x) \) discontinuous at \( x = 0 \). However, this discontinuity is not a jump; rather, the derivative takes on all values between -1 and 1 infinitely often. This confirms Darboux’s theorem while showing that continuity of \( f'(x) \) is not guaranteed.

Example

The function

\[ g(x) = \begin{cases} 1, & x \geq 0, \\ -1, & x < 0 \end{cases} \]

cannot be the derivative of any function \( f(x) \), because it has a jump discontinuity at \( x = 0 \).

If \( g(x) \) were the derivative of some function \( f(x) \), then \( f(x) \) would be differentiable everywhere, which would mean that \( f'(x) \) must satisfy Darboux’s Theorem. This theorem guarantees that the derivative of a differentiable function must have the intermediate value property, meaning that it cannot "jump" from one value to another without taking all values in between.

However, in this case, \( g(x) \) jumps from \( -1 \) to \( 1 \) at \( x = 0 \), skipping all intermediate values between \( -1 \) and \( 1 \). Since this violates the intermediate value property, it follows that \( g(x) \) cannot be the derivative of any function.