Home / Articles / Calculus
Calculus · 4 min read

Continuity of Functions Explained

Learn what makes a function continuous, the three-part test, types of discontinuity, and how to find unknown constants in piecewise functions, step by step.

Informally, a function is continuous if you can draw its graph without lifting your pen. That picture is a good start, but exams in FSc, A Level and university calculus expect a precise test you can apply to any function. This guide explains that test, the types of discontinuity, and the classic "find \( k \)" questions.

The Formal Definition

A function \( f \) is continuous at \( x = a \) if all three of these conditions hold:

  1. \( f(a) \) is defined.
  2. \( \displaystyle \lim_{x \to a} f(x) \) exists (the left-hand and right-hand limits are equal).
  3. The limit equals the function value:

$$ \lim_{x \to a} f(x) = f(a) $$

If any one condition fails, \( f \) is discontinuous at \( a \).

A function is continuous on an interval if it is continuous at every point in that interval. For a closed interval \( [a, b] \), we use one-sided limits at the endpoints.

Functions That Are Always Continuous

You do not need to test these every time. They are continuous wherever they are defined:

  • Polynomials, such as \( x^3 - 4x + 1 \), are continuous for all real \( x \).
  • Rational functions \( \frac{p(x)}{q(x)} \) are continuous except where \( q(x) = 0 \).
  • \( \sin x \), \( \cos x \), \( e^x \) are continuous everywhere.
  • \( \ln x \) is continuous for \( x > 0 \); \( \sqrt{x} \) for \( x \ge 0 \).
  • Sums, differences, products, quotients (with nonzero denominator) and compositions of continuous functions are continuous.

So in practice, the points you need to check are where a denominator is zero and where a piecewise function changes its rule.

Types of Discontinuity

1. Removable discontinuity

The limit exists, but \( f(a) \) is either undefined or not equal to the limit. The graph has a single "hole". Example:

$$ f(x) = \frac{x^2 - 4}{x - 2} $$

has a hole at \( x = 2 \), because the limit is 4 but \( f(2) \) is undefined. Defining \( f(2) = 4 \) would "remove" the discontinuity.

2. Jump discontinuity

The left-hand and right-hand limits both exist but are different, so the graph jumps. This often happens in piecewise functions and step functions such as the floor function.

3. Infinite discontinuity

The function grows without bound near \( a \), giving a vertical asymptote. Example: \( f(x) = \frac{1}{x - 3} \) at \( x = 3 \).

Worked Example 1: Testing a Piecewise Function

Question: Is the function below continuous at \( x = 2 \)?

$$ f(x) = \begin{cases} x^2 + 1, & x < 2 \\ 5, & x = 2 \\ 3x - 1, & x > 2 \end{cases} $$

Solution:

  • Step 1: Is \( f(2) \) defined? Yes, \( f(2) = 5 \).
  • Step 2: Left-hand limit. Use the rule for \( x < 2 \):

$$ \lim_{x \to 2^-} (x^2 + 1) = 4 + 1 = 5 $$

  • Step 3: Right-hand limit. Use the rule for \( x > 2 \):

$$ \lim_{x \to 2^+} (3x - 1) = 6 - 1 = 5 $$

  • Step 4: Compare. Both one-sided limits equal 5, so \( \lim_{x \to 2} f(x) = 5 \).
  • Step 5: Check the third condition. \( \lim_{x \to 2} f(x) = 5 = f(2) \).

All three conditions hold, so \( f \) is continuous at \( x = 2 \).

Worked Example 2: Finding an Unknown Constant

Question: Find the value of \( k \) that makes \( g \) continuous for all \( x \).

$$ g(x) = \begin{cases} kx + 3, & x \le 1 \\ x^2 - k, & x > 1 \end{cases} $$

Solution:

  • Step 1: Identify the only point to check. Each piece is a polynomial, so \( g \) is continuous everywhere except possibly at \( x = 1 \).
  • Step 2: Function value and left limit.

$$ g(1) = \lim_{x \to 1^-} (kx + 3) = k + 3 $$

  • Step 3: Right limit.

$$ \lim_{x \to 1^+} (x^2 - k) = 1 - k $$

  • Step 4: Set them equal.

$$ k + 3 = 1 - k \quad \Rightarrow \quad 2k = -2 \quad \Rightarrow \quad k = -1 $$

  • Step 5: Check. With \( k = -1 \): left side \( -1 + 3 = 2 \), right side \( 1 - (-1) = 2 \). Both equal 2, so \( g \) is continuous.

Worked Example 3: Classifying Discontinuities

Question: Find and classify the discontinuities of

$$ h(x) = \frac{x - 1}{x^2 - 4x + 3} $$

Solution:

  • Step 1: Factorise the denominator.

$$ x^2 - 4x + 3 = (x - 1)(x - 3) $$

So \( h \) is undefined at \( x = 1 \) and \( x = 3 \).

  • Step 2: Simplify. For \( x \ne 1 \),

$$ h(x) = \frac{x - 1}{(x - 1)(x - 3)} = \frac{1}{x - 3} $$

  • Step 3: At \( x = 1 \): \( \lim_{x \to 1} \frac{1}{x - 3} = \frac{1}{-2} = -\frac{1}{2} \). The limit exists but \( h(1) \) is undefined, so this is a removable discontinuity (a hole at \( \left(1, -\frac{1}{2}\right) \)).
  • Step 4: At \( x = 3 \): the denominator approaches 0 while the numerator approaches 1, so \( h(x) \to \pm\infty \). This is an infinite discontinuity with a vertical asymptote \( x = 3 \).

Common Mistakes

  • Checking only that the limits match and forgetting to compare with \( f(a) \).
  • Using the wrong piece for a one-sided limit. Match the inequality sign carefully.
  • Assuming every zero of the denominator is an asymptote. Factorise first; it may be a removable hole.
  • Forgetting the endpoint. In "\( x \le 1 \)", the value \( g(1) \) comes from the first piece.

Tips

  • Write all three conditions out explicitly in exam answers; each usually earns a mark.
  • For "find \( k \)" questions, set the two one-sided limits equal at the joining point.
  • When there are two unknowns, you will need two joining points (or one continuity and one differentiability condition).

Key Takeaways

  • Continuity at \( a \) requires: \( f(a) \) defined, the limit exists, and the limit equals \( f(a) \).
  • Polynomials, sine, cosine and exponentials are continuous everywhere.
  • Discontinuities can be removable (hole), jump, or infinite (asymptote).
  • Check denominators equal to zero and the joining points of piecewise functions.
  • To make a piecewise function continuous, equate the one-sided limits at the joining point.

Have a continuity proof or calculus assignment you are unsure about? Amathify's subject experts and PhD scholars can provide clear step-by-step solutions, so message us on WhatsApp or use the "Ask a Question" form.

Stuck on a problem or assignment?

Our experts and PhD scholars solve maths, physics and chemistry — step by step.

WhatsApp usAsk a question

Related articles