Ma · Mathematics

Example of a Continuous Function Differentiable on [a,b)

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose a function

    Let f(x) = sqrt(b − x) on the closed interval [a,b].

  2. 2. Check continuity

    The square-root function is continuous, including at x = b, where f(b) = 0.

  3. 3. Check differentiability

    For x in [a,b), the derivative exists; at a, use the right-hand derivative.

  4. 4. Check the endpoint

    At b, the difference quotient is unbounded, so there is no finite left derivative.

A standard example is a function that stays continuous at the right endpoint while its slope becomes unbounded as it approaches that endpoint. For any real numbers a < b, set

f(x)=b−x,a≤x≤b.f(x)=\sqrt{b-x}, \qquad a\le x\le b.

This function is continuous on [a,b] and differentiable throughout [a,b), including at a if differentiability at the left endpoint is interpreted as a right-hand derivative. It is not differentiable at b in the usual finite-derivative sense.

Differentiability on a half-closed interval

The phrase “semi-differentiable” is not used uniformly across mathematics. In this context, the usual intended meaning is that the function is differentiable at the points of [a,b), with a one-sided derivative at the included endpoint a. The endpoint b is excluded from the differentiability requirement, even though the function must still be continuous there.

For an interior point x, differentiability uses the ordinary two-sided limit. At the left endpoint a, the derivative from within the interval is

f+′(a)=lim⁡h→0+f(a+h)−f(a)h.f'_+(a)=\lim_{h\to 0^+}\frac{f(a+h)-f(a)}{h}.

If “semi-differentiable” is being used with a different definition in your course or text, check that convention; the example below satisfies this common half-interval interpretation.

Verify the example

Since the square-root function is continuous on the nonnegative reals and b − x ≥ 0 throughout [a,b], the composition b−x\sqrt{b-x} is continuous on [a,b]. In particular, f(b)=0f(b)=0, and values of f(x) approach 0 as x approaches b from the left.

For every x in (a,b), the chain rule gives

f′(x)=−12b−x.f'(x)=-\frac{1}{2\sqrt{b-x}}.

This is a finite real number for each such x. At a, take the right-hand derivative:

f+′(a)=lim⁡h→0+b−a−h−b−ah=−12b−a.\begin{aligned} f'_+(a) &=\lim_{h\to 0^+}\frac{\sqrt{b-a-h}-\sqrt{b-a}}{h}\\ &=-\frac{1}{2\sqrt{b-a}}. \end{aligned}

The limit is finite because a < b. Thus the function is differentiable at every point of [a,b) under the stated endpoint convention.

At b, however, the left-hand difference quotient is, for h < 0,

f(b+h)−f(b)h=−hh=−1−h.\frac{f(b+h)-f(b)}{h} =\frac{\sqrt{-h}}{h} =-\frac{1}{\sqrt{-h}}.

As h approaches 0 from below, this tends to −∞-\infty, not to a finite real number. So f has no finite left derivative at b. That does not conflict with continuity at b: continuity requires the function values to approach f(b), not the difference quotients to have a finite limit.

A concrete case

On [0,1], take f(x)=1−xf(x)=\sqrt{1-x}. Then f(1)=0f(1)=0, and for 0≤x<10\le x<1 its derivative is

f′(x)=−121−x,f'(x)=-\frac{1}{2\sqrt{1-x}},

where the value at 0 is understood as the right-hand derivative, f+′(0)=−1/2f'_+(0)=-1/2. As x approaches 1 from below, the derivative becomes arbitrarily large in magnitude, but the function itself approaches 0. The left difference quotient at 1 is −1/1−x-1/\sqrt{1-x}, which has no finite limit.

Common mistakes

  • Confusing continuity with differentiability: A function can be continuous at b even when it has no finite derivative there.
  • Ignoring the endpoint convention: On [a,b), a is included and b is not. If differentiability at a is required, it is normally defined using a right-hand limit.
  • Saying the derivative is infinite: An infinite limiting slope is not a finite derivative. It indicates that the derivative does not exist as a real number.
  • Forgetting a < b: The interval must have positive length for the example and endpoint calculation to apply.

If the goal is only to find a function continuous on [a,b] and differentiable on [a,b), the example works. If instead differentiability is required at both endpoints, this function does not meet that stronger condition.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.