Limit Calculator

Find the limit of a function step by step: two-sided, left-hand, right-hand and infinity limits, 0/0 forms, and a table and graph.

Use x as the variable: x^2, sqrt(x), sin(x), ln(x), log(x) (base 10), e^x, abs(x) or |x|, pi. Write 3x or 3*x; put function arguments in parentheses.

A number such as 2, −1/2, 0.5 or pi/2.

limx→2(x² − 4)/(x − 2)

Examples

Basic
Direct substitution
Trigonometric
Rationalization
Infinity
Does not exist
Infinite
L'Hôpital's Rule

Limit

limx→2(x² − 4)/(x − 2)=4

Finite limit existsExact result

Method
Factoring and cancellation
Value at x = 2
f(2) = (2² − 4)/(2 − 2) is undefined (0/0)

f(2) is undefined, yet the limit exists: a limit depends only on the values of f(x) near 2, not at 2 itself (a removable discontinuity, or “hole”).

One-sided limits

lim(x → 2⁻) f(x) = 4

lim(x → 2⁺) f(x) = 4

Both sides agree, so the two-sided limit exists and equals 4.

Step-by-Step Solution

Problem: lim(x → 2) (x² − 4)/(x − 2)

  1. Step 1 — Substitute x = 2

    Direct substitution gives the indeterminate form 0/0. That does not mean the limit fails to exist; the expression has to be simplified first.

    (2² − 4)/(2 − 2) → 0/0

  2. Step 2 — Factor the numerator and denominator

    Since x = 2 makes both equal to 0, each has (x − 2) as a factor.

    x² − 4 = (x − 2)(x + 2)

    x − 2 = (x − 2)

  3. Step 3 — Cancel the common factor

    x only approaches 2 and never equals it, so (x − 2) ≠ 0 and it can be cancelled.

    ((x − 2)(x + 2))/(x − 2) = x + 2

  4. Step 4 — Evaluate the simplified expression

    The simplified expression is continuous at x = 2, so substitute directly.

    2 + 2 = 4

Final answer: lim(x → 2) (x² − 4)/(x − 2) = 4

Table of values

f(x) evaluated as x gets closer to 2 from each side. Watch what the values do as x gets closer.

Values of f(x) as x approaches 2
Sidexf(x)
Left (x < a)1.93.9
Left (x < a)1.993.99
Left (x < a)1.9993.999
Right (x > a)2.0014.001
Right (x > a)2.014.01
Right (x > a)2.14.1
At a2f(2) = (2² − 4)/(2 − 2) is undefined (0/0)

Graph of f(x) near x = 2

Graph of f(x) near the targetGraph of f(x) = (x² − 4)/(x − 2) for x from −1 to 5. The dashed vertical line marks x = 2. The solid curve is the left side and the dashed curve the right side. An open circle at (2, 4) marks the limit.−1123451234567
  • Left side (x < 2)
  • Right side (x > 2)
  • Limit value

The graph only illustrates the behaviour near the target; the answer comes from the algebra above, not from the picture.

Limits define the derivative: find it with the Derivative Calculator, or the slope at a point with the Tangent Line Calculator. Definite integrals are limits of sums, worked in the Integral Calculator. To see where a function is undefined before taking a limit, use the Function Domain Calculator; for quick evaluations of f(x), the Scientific Calculator.

This limit calculator finds the limit of a function as x approaches a number, from the left, from the right, or as x → ±∞. It shows every step of the working: direct substitution when the function is continuous, and when substitution gives 0/0 or another indeterminate form, the method that resolves it, such as factoring and cancelling, multiplying by the conjugate, a standard trigonometric limit, dividing by the highest power of x, or L'Hôpital's Rule.

The result says clearly whether the limit is a finite number, +∞ or −∞, or does not exist, compares the left-hand and right-hand limits, and backs the answer up with a table of values and a graph of f(x) near the target.

Worked Calculation Examples

ScenarioResultCalculation Step
lim(x→2) (x² − 4)/(x − 2)4Substitution gives 0/0. Factor: x² − 4 = (x − 2)(x + 2). Cancel (x − 2) to get x + 2, then substitute: 2 + 2 = 4.
lim(x→0) sin(x)/x1Substitution gives 0/0. This is the standard trigonometric limit sin θ/θ → 1 as θ → 0 (x in radians).
lim(x→0) (√(x + 1) − 1)/x1/2Multiply by the conjugate √(x + 1) + 1: the numerator becomes (x + 1) − 1 = x. Cancel x to get 1/(√(x + 1) + 1), and substitute x = 0: 1/2.
lim(x→∞) (3x + 1)/x3Divide every term by x: (3x + 1)/x = 3 + 1/x. As x → ∞, 1/x → 0, so the limit is 3.
lim(x→0) 1/x²∞The numerator is 1 and x² → 0 while staying positive on both sides, so 1/x² grows without bound: the limit is +∞ (a vertical asymptote at x = 0).
lim(x→0) |x|/xDoes not existFor x > 0, |x|/x = 1; for x < 0, |x|/x = −1. The right-hand limit is 1 and the left-hand limit is −1, so the two-sided limit does not exist.

What Is a Limit?

A limit describes the value a function approaches as its input approaches some number. In lim(x→2) (x² − 4)/(x − 2) = 4, the function is undefined at x = 2, yet its values get as close to 4 as you like when x is close to 2: f(1.99) = 3.99 and f(2.01) = 4.01.

That is the key idea: a limit is about the behaviour near a, not the value at a. The function can be undefined at a, or defined with a different value, and the limit can still exist.

How to Find a Limit

Start by substituting x = a. If the result is a number, and the function is built from continuous pieces, that number is the limit. If you get a nonzero number divided by 0, the function has a vertical asymptote and the limit is +∞, −∞, or does not exist, depending on the signs on each side.

If you get 0/0, ∞/∞, ∞ − ∞, 0 · ∞, 1^∞, 0^0 or ∞^0, the form is indeterminate: it gives no answer on its own, and the expression has to be rewritten before the limit can be found.

How the Limit Calculator Works

The calculator first pushes the limit through the expression with the limit laws, substituting wherever the function is continuous. When that produces an indeterminate form, it tries textbook methods in order: factoring and cancelling for rational functions, a common denominator, rewriting |x| on each side, the standard trigonometric limits, the conjugate for square roots, dominant terms and degree comparison at infinity, logarithms for powers, and L'Hôpital's Rule.

The steps shown are the steps it actually used. Each exact answer is also compared with f(x) evaluated close to the target. If the two disagree, or no method applies, the answer is labelled as a numerical estimate rather than presented as exact.

Direct Substitution

Polynomials, rational functions where the denominator is not 0, roots, exponentials, logarithms and trigonometric functions are continuous wherever they are defined. For these, the limit is just the function value: lim(x→3) (x² + 2x + 1) = 9 + 6 + 1 = 16.

Substitution is always the first thing to try. It only fails when it produces division by zero, an indeterminate form, or a value outside the domain.

When Substitution Gives 0/0

The form 0/0 means the numerator and the denominator both approach 0, and their ratio could approach anything. For example, x/x → 1, x²/x → 0 and x/x² has no finite limit at 0, even though all three give 0/0 at x = 0.

So 0/0 is not an answer and not a reason to say the limit does not exist. It is a signal to simplify. Usually it means the numerator and denominator share a factor, often (x − a), that can be cancelled.

How to Solve 0/0 Limits

Factor and cancel: (x² − 4)/(x − 2) = (x − 2)(x + 2)/(x − 2) = x + 2 for x ≠ 2, so the limit as x → 2 is 4.

Multiply by the conjugate when there is a square root: (√(x + 1) − 1)/x becomes x/(x(√(x + 1) + 1)) = 1/(√(x + 1) + 1), so the limit as x → 0 is 1/2.

Use a standard limit for trigonometric expressions, such as sin(x)/x → 1. If none of these apply, L'Hôpital's Rule replaces f/g by f′/g′.

One-Sided Limits

The left-hand limit lim(x→a⁻) f(x) uses only x-values less than a, and the right-hand limit lim(x→a⁺) f(x) uses only values greater than a. The two-sided limit exists exactly when both one-sided limits exist and are equal.

For f(x) = |x|/x, the left-hand limit at 0 is −1 and the right-hand limit is 1. The graph jumps, so lim(x→0) |x|/x does not exist, although each one-sided limit does. One-sided limits are also needed at the edge of a domain: lim(x→0⁺) √x = 0, while √x is not defined to the left of 0.

Limits at Infinity

A limit at infinity describes what f(x) does as x grows without bound. For rational functions, compare the degrees of the numerator and denominator. If the denominator's degree is higher, the limit is 0. If the degrees are equal, the limit is the ratio of the leading coefficients. If the numerator's degree is higher, the function grows without bound.

To see why, divide every term by the highest power of x in the denominator: (3x + 1)/x = 3 + 1/x, and since 1/x → 0, the limit as x → ∞ is 3. A finite limit at infinity is a horizontal asymptote of the graph.

Infinite Limits

When substitution gives a nonzero number divided by 0, the function grows without bound near a, and the graph has a vertical asymptote at x = a. Check the sign on each side: 1/x² is positive on both sides of 0, so lim(x→0) 1/x² = ∞, but 1/x is negative on the left and positive on the right, so its two one-sided limits are −∞ and ∞ and the two-sided limit does not exist.

Writing lim f(x) = ∞ is a precise description of how the limit fails to exist as a real number: the values increase beyond every bound.

Limits That Do Not Exist

A limit does not exist when the left-hand and right-hand limits are different (a jump), when the function grows without bound in different directions on the two sides, when it oscillates without settling, as sin(1/x) does near 0, or when the function is not defined on one side of the point for a two-sided limit.

A limit that does not exist is still a definite answer. It is different from a function value that is undefined: f(a) can be undefined while the limit exists, and the limit can fail to exist even when f(a) is defined.

Important Limit Laws

If lim f(x) = L and lim g(x) = M, then lim [f(x) ± g(x)] = L ± M, lim [c · f(x)] = c · L, lim [f(x) · g(x)] = L · M, and lim [f(x)/g(x)] = L/M provided M ≠ 0. Powers and roots pass through as well: lim [f(x)]ⁿ = Lⁿ.

The Squeeze Theorem covers products with a bounded, oscillating factor: if g(x) ≤ f(x) ≤ h(x) and both g and h approach L, so does f. That is why lim(x→0) x · sin(1/x) = 0.

L'Hôpital's Rule: if f/g gives 0/0 or ∞/∞ and lim f′(x)/g′(x) exists (or is ±∞), then lim f(x)/g(x) equals it. It applies only to those two forms, and other forms must be rewritten as a quotient first.

Common Trigonometric Limits

lim(x→0) sin(x)/x = 1 and lim(x→0) tan(x)/x = 1, with x in radians. More generally, lim(x→0) sin(kx)/(kx) = 1, so lim(x→0) sin(3x)/(5x) = (3/5) · 1 = 3/5.

lim(x→0) (1 − cos x)/x² = 1/2 and lim(x→0) (1 − cos x)/x = 0. Two related exponential and logarithmic limits are lim(x→0) (eˣ − 1)/x = 1 and lim(x→0) ln(1 + x)/x = 1, and the number e itself is a limit: lim(x→∞) (1 + 1/x)ˣ = e.

Limit Examples

lim(x→2) (x² − 4)/(x − 2) = 4, by factoring and cancelling (x − 2).

lim(x→0) (√(x + 1) − 1)/x = 1/2, by multiplying by the conjugate √(x + 1) + 1.

lim(x→∞) (3x² + 2x − 1)/(x² − 5) = 3, since the degrees are equal and the leading coefficients are 3 and 1.

lim(x→0) (x − sin x)/x³ = 1/6, by L'Hôpital's Rule followed by the standard limit (1 − cos x)/x² → 1/2.

lim(x→0) |x|/x does not exist, because the left-hand limit is −1 and the right-hand limit is 1.

How to Use the Limit Calculator

  1. Type the function after “Limit of”, for example (x^2 - 4)/(x - 2) or sin(x)/x. Use ^ for powers, sqrt( ) for square roots, abs( ) or |x| for absolute value, ln( ) for the natural log and e^x for the exponential. The buttons under the box insert these for you.
  2. Enter the value x approaches (a number such as 2, −1/2, 0.5 or pi/2) and choose the approach type: two-sided, from the left (x → a⁻), from the right (x → a⁺), or x → +∞ / −∞.
  3. Press Calculate, or tap one of the examples. The answer shows the limit, whether it is a finite limit, an infinite limit (±∞) or does not exist, and the method used.
  4. Read the step-by-step solution. It shows exactly what the calculator did: direct substitution, factoring and cancelling, the conjugate, a standard trigonometric limit, dividing by the highest power, or L’Hôpital’s Rule.
  5. For a two-sided limit, check the one-sided analysis: the left-hand and right-hand limits must be equal for the limit to exist. The table of values and the graph show f(x) approaching the answer from each side.

Frequently Asked Questions

What is a limit in calculus?

The value a function approaches as its input approaches a given number (or ±∞). lim(x→a) f(x) = L means f(x) can be made as close to L as you like by taking x close enough to a, with x ≠ a.

How do you calculate a limit?

Substitute x = a first. If you get a number and the function is continuous there, that is the limit. If you get 0/0 or another indeterminate form, simplify by factoring, using the conjugate, a standard limit or L’Hôpital’s Rule. If you get a nonzero number over 0, check the signs on each side for ±∞.

How do I find a limit step by step?

Enter the function and the value x approaches in the calculator above. It shows each step it takes: the substitution, the form it produces, the method used to resolve it, and the final evaluation, plus a table of values from each side.

What does 0/0 mean in a limit?

It is an indeterminate form: the numerator and denominator both approach 0, so their ratio could approach any value, or none. It means the expression must be simplified first, often by cancelling a common factor (x − a). It does not mean the limit is 0 or does not exist.

What does it mean when a limit does not exist?

The function does not approach one single finite value. This happens when the left-hand and right-hand limits differ, when the function oscillates, when it grows without bound in different directions on the two sides, or when it is undefined on one side of the point.

What is a left-hand limit?

The value f(x) approaches as x approaches a from values less than a, written lim(x→a⁻) f(x). For |x|/x at 0, the left-hand limit is −1.

What is a right-hand limit?

The value f(x) approaches as x approaches a from values greater than a, written lim(x→a⁺) f(x). For |x|/x at 0, the right-hand limit is 1. The two-sided limit exists only when the left-hand and right-hand limits are equal.

How do you find a limit at infinity?

For a rational function, divide every term by the highest power of x in the denominator; terms like c/x and c/x² approach 0. The result depends on the degrees: a higher-degree denominator gives 0, equal degrees give the ratio of the leading coefficients, and a higher-degree numerator gives ±∞.

Can a limit exist when the function is undefined?

Yes. (x² − 4)/(x − 2) is undefined at x = 2, but its limit there is 4, because the limit only depends on values near 2. The graph has a hole at (2, 4), called a removable discontinuity.

When should I use L'Hôpital's Rule?

Only when the limit has the form 0/0 or ∞/∞ and the functions are differentiable near the point. Then lim f/g = lim f′/g′, if the new limit exists. Forms such as 0 · ∞ or ∞ − ∞ must be rewritten as a quotient first. Simpler methods like factoring are often quicker.

What is the difference between a limit and a function value?

The function value f(a) is what the function equals at x = a. The limit is what f(x) approaches as x gets close to a. They are equal exactly when the function is continuous at a; at a hole or a jump they differ, or one of them does not exist.

Does this calculator give exact answers?

Yes, whenever an algebraic method settles the limit: answers such as 1/2, √2/2, π/2 or e are exact, and irrational ones also show a decimal. If no method applies, the answer is marked as a numerical estimate (≈) based on values of f(x) near the target, and it should be treated as evidence rather than proof.

Last updated: September 27, 2026.