Blog

Domain of Rational, Modulus, Log and Greatest Integer Functions

Find domains using clear restriction rules, solved examples, sign checks and practice questions for rational, modulus, logarithmic and greatest integer functions.

  • 11th
Glowing pearls follow paths through stone gateways and steps toward a sunlit garden

You simplify a fraction, cancel a factor, and write “all real numbers” as the domain. Everything looks neat. Then the answer key excludes the very number you cancelled away.

Or you see a greatest integer function and decide that x must be an integer. That feels reasonable too, until you try putting 2.6 into it and get a perfectly valid answer.

Domain questions become much easier once you stop asking what kind of function the expression resembles and start asking which operations must be possible at the chosen input.

This guide builds that habit through rational, modulus, logarithmic and greatest integer functions. We will also use square roots in a few mixed examples, because that is where otherwise familiar rules often collide.

What Does the Domain Actually Mean?

The domain is the set of allowed inputs. The range is the set of outputs actually obtained. Those are two different questions.

For f(x) = x^2, a negative input causes no trouble: f(-4) = 16. The output is nonnegative, but the input does not have to be.

Unless a question specifies otherwise, we will look for the largest real domain: all real x-values for which the displayed expression gives a defined real value.

A stated domain takes priority. If a function is defined only for x in [0, 5], you cannot expand that interval just because its formula would also work at 8. Similarly, a model for the number of notebooks sold may require nonnegative integer inputs even when its algebra permits fractions.

For the general distinction between allowed inputs, real roots and denominator restrictions, see OpenStax’s explanation of domain and range.

The Notation Used Here

  • R means all real numbers.
  • abs(x) means the modulus or absolute value of x, also written with vertical bars.
  • floor(x) means the greatest integer less than or equal to x, often written [x] in textbooks.
  • sqrt(x) means the nonnegative square root of x.
  • ln(x) means logarithm to base e.
  • union joins allowed intervals; an intersection keeps only their overlap.

In interval notation, a square bracket includes an endpoint and a round bracket excludes it. Thus, [-2, 4) includes -2 but excludes 4. Infinity always takes a round bracket because it is not a real-number endpoint you can include.

Your Domain Checklist

Operation in the expressionCondition to write
Division by g(x)g(x) must exist and must not equal 0
sqrt(g(x))g(x) must exist and be at least 0
1/sqrt(g(x))g(x) must exist and be strictly positive
log_b(g(x))g(x) > 0, with b > 0 and b != 1
abs(g(x))g(x) must already be defined and real
floor(g(x))g(x) must already be defined and real

A polynomial creates no restriction by itself. Modulus and floor also accept every real number, but they do not repair an undefined expression inside them.

A reliable written solution has four parts:

  1. List the restrictions before simplifying.
  2. Solve each restriction as an equation or inequality.
  3. Combine simultaneous conditions by intersection.
  4. Check the boundary values in the original formula.

Let’s put that to work.

1. Rational Functions: Exclude Zeros of the Denominator

For a rational function P(x)/Q(x), where P and Q are polynomials and Q is not the zero polynomial, the domain consists of every real number except the zeros of Q.

The numerator may be zero. A zero numerator gives a valid output of zero when the denominator is nonzero.

Example 1: A Factor Cancels, but the Exclusion Remains

Find the domain of:

f(x) = (x^2 - 16)/(x^2 - x - 12)

Factor the original denominator:

x^2 - x - 12 = (x - 4)(x + 3)

It vanishes at x = 4 and x = -3. Therefore:

Domain: R except {-3, 4}.

You can simplify the expression to (x + 4)/(x + 3), but that simplification is valid only where the original expression exists. At x = 4, the original fraction is 0/0, which is undefined.

The simplified formula on its own could be used to define a different function with a larger domain. It does not silently enlarge the domain of the original one.

Example 2: Not Every Denominator Removes a Real Number

For g(x) = (3x - 1)/(x^2 + 9), the denominator is always positive because x^2 >= 0.

There are no real zeros to exclude.

Domain: R.

The rule is not “a fraction has a restricted domain”. The rule is “division by zero is forbidden”. Sometimes the denominator never reaches zero.

2. Modulus Functions: Negative Inputs Are Allowed

For abs(x - 5), every real input works. At x = 2, the inner value is -3, and its modulus is 3.

The fact that a modulus output cannot be negative is a statement about its range, not a demand that its input be nonnegative.

Example 3: A Modulus in the Denominator

Find the domain of:

f(x) = 1/(abs(x - 2) - 3)

The denominator must not be zero:

abs(x - 2) != 3

To find the forbidden values, solve the corresponding equality:

x - 2 = 3 or x - 2 = -3

So x = 5 and x = -1 are excluded.

Domain: R except {-1, 5}.

You do not need a piecewise expansion of the whole function. Solving one modulus equation is enough.

Compare this with 1/(abs(x - 2) + 3). That denominator is at least 3, so its domain is all real numbers.

Example 4: A Square Root Around a Modulus Expression

Find the domain of:

h(x) = sqrt(4 - abs(x + 1))

The square root requires:

4 - abs(x + 1) >= 0

Therefore:

abs(x + 1) <= 4

Convert the modulus condition into a double inequality:

-4 <= x + 1 <= 4

Subtract 1 throughout:

-5 <= x <= 3

Domain: [-5, 3].

Both endpoints are included because each gives sqrt(0), a valid output.

If the same square root appeared in the denominator, both endpoints would be excluded, giving (-5, 3).

Modulus Does Not Rescue an Invalid Inside Expression

Compare these three functions:

FunctionReal domainReason
abs(x - 5)REvery real inner value has a modulus
abs(1/(x - 5))R except {5}Inner division fails at 5
abs(sqrt(x - 5))[5, infinity)Inner square root requires x >= 5

Work from the inside outward whenever an expression is nested.

3. Logarithmic Functions: The Argument Must Be Positive

For a real logarithm log_b(u), the argument u must be strictly positive. The base must also satisfy b > 0 and b != 1. A logarithm may have a negative output; that does not make it invalid. For example, log_2(1/2) = -1. These conditions follow from the definition of a logarithmic function.

In the examples below, ln has the fixed valid base e. A variable base needs extra checks, which we will handle separately.

Example 5: A Fraction Inside a Logarithm

Find the domain of:

f(x) = ln((x - 2)/(x + 4))

The complete argument must be positive:

(x - 2)/(x + 4) > 0

The critical values are -4, where the denominator vanishes, and 2, where the numerator vanishes.

IntervalSign of x - 2Sign of x + 4Quotient
x < -4NegativeNegativePositive
-4 < x < 2NegativePositiveNegative
x > 2PositivePositivePositive

Keep the intervals with a positive quotient.

Domain: (-infinity, -4) union (2, infinity).

At -4 the fraction is undefined. At 2 the fraction is zero, and ln(0) is undefined. Both boundary values are excluded, for different reasons.

Notice that the numerator and denominator do not each have to be positive. Two negative values also give a positive quotient.

Example 6: A Logarithm in the Denominator

Find the domain of:

g(x) = 1/ln(x + 3)

There are two separate checks.

First, the logarithm must exist:

x + 3 > 0, so x > -3.

Second, the logarithm must not be zero:

ln(x + 3) != 0

Since ln(1) = 0, we need x + 3 != 1, giving x != -2.

Domain: (-3, -2) union (-2, infinity).

A positive argument is enough for a logarithm to exist. It is not enough when the logarithm itself is a denominator.

Example 7: When the Base Depends on x

Consider log_(x - 1)(x + 2), meaning logarithm of (x + 2) to base (x - 1).

Write all three conditions:

  • Argument: x + 2 > 0, giving x > -2.
  • Base positive: x - 1 > 0, giving x > 1.
  • Base not 1: x - 1 != 1, giving x != 2.

Their common solution is:

Domain: (1, 2) union (2, infinity).

Values between 1 and 2 are allowed. The base then lies between 0 and 1, which is valid for a logarithm.

A Logarithm Simplification Can Change the Apparent Domain

ln(x^2) is defined for every nonzero real x because x^2 > 0 there.

But 2ln(x) is defined only for x > 0.

For negative x, the safe real identity is ln(x^2) = 2ln(abs(x)). Record the original domain before applying logarithm laws, just as you record denominator exclusions before cancelling factors.

4. Greatest Integer Functions: Watch Whole Intervals

The greatest integer function floor(x) returns the largest integer no greater than x. Its input can be any real number; its output is an integer. The standard definition is given in Wolfram MathWorld’s floor-function reference.

For example:

  • floor(2.6) = 2
  • floor(2) = 2
  • floor(-0.2) = -1
  • floor(-2.6) = -3

For negative numbers, move down the number line to the next integer when the input is not already an integer. Do not simply remove the decimal part.

The useful conversion is:

floor(u) = n exactly when n <= u < n + 1, where n is an integer.

This is why a denominator containing floor can exclude an entire interval.

Example 8: The Denominator Is Zero on a Whole Step

Find the domain of:

f(x) = 1/(floor(x) - 2)

The forbidden condition is floor(x) = 2.

That happens throughout 2 <= x < 3.

Remove that complete interval, not just the integer 2.

Domain: (-infinity, 2) union [3, infinity).

Why is 3 included? Because floor(3) - 2 = 1, so the denominator is nonzero. Why is 2.9 excluded? Because floor(2.9) - 2 = 0.

Example 9: A Shifted Input Inside Floor

Find the domain of:

g(x) = 1/floor(2x - 1)

The denominator is zero when:

0 <= 2x - 1 < 1

Add 1 and divide by 2:

1/2 <= x < 1

Therefore:

Domain: (-infinity, 1/2) union [1, infinity).

Translate the step interval back into x before writing the answer. The excluded interval belongs to the input of the floor operation first.

Example 10: A Floor Function Inside a Logarithm

Find the domain of:

h(x) = ln(floor(x - 1))

The logarithm requires:

floor(x - 1) > 0

Since a floor output is an integer, being positive means being at least 1:

floor(x - 1) >= 1

This is equivalent to x - 1 >= 1, so:

Domain: [2, infinity).

The endpoint 2 is included. At x = 2, the logarithm’s argument is 1, and ln(1) = 0 is valid.

A strict condition on the floor output has produced a closed endpoint for x. This is a good reminder to solve the condition rather than guessing the bracket from the inequality sign you started with.

For more help picturing the steps, see our guide to modulus, signum and greatest integer graphs.

5. Mixed Functions: Every Condition Must Hold Together

A long expression does not need a new rule. It needs a complete list of the familiar ones.

Example 11: Root, Logarithm and Denominator Together

Find the domain of:

F(x) = sqrt(x + 2) / ((x - 1) ln(5 - x))

The restriction list is:

SourceConditionAllowed inputs
Square rootx + 2 >= 0x >= -2
Linear denominator factorx - 1 != 0x != 1
Logarithm argument5 - x > 0x < 5
Logarithm denominator factorln(5 - x) != 0x != 4

The first and third conditions give [-2, 5). Remove 1 and 4 from that interval.

Domain: [-2, 1) union (1, 4) union (4, 5).

At x = -2, the numerator is zero and the denominator is nonzero, so the output is zero. That endpoint stays.

At x = 4, the logarithm exists, but its value is zero. That point goes.

Example 12: Modulus and Floor Together

Find the domain of:

G(x) = ln(abs(x - 1)) / (floor(x) - 1)

The logarithm requires abs(x - 1) > 0, so x != 1.

The denominator requires floor(x) != 1, excluding the interval [1, 2).

The single forbidden point 1 is already inside that interval. No extra gap is needed.

Domain: (-infinity, 1) union [2, infinity).

At x = 2, the numerator is ln(1) = 0 and the denominator is 1, so x = 2 is allowed.

When There Are No Allowed Inputs

Consider sqrt(x - 4) + ln(3 - x).

The square root requires x >= 4. The logarithm requires x < 3. No real number satisfies both, so the expression has no real inputs for which it is defined. Its natural real domain is the empty set.

Do not join the two intervals with “or”. Both terms must exist at the same input for their sum to exist.

Mistakes Worth Checking Before You Finish

Tempting answerWhat went wrong
Excluding a zero of the numeratorZero output is allowed if the rest of the expression exists
Restoring a cancelled denominator valueThe original formula remains undefined there
Requiring the inside of modulus to be positiveModulus accepts negative real inputs too
Allowing zero as a logarithm argumentLogarithm arguments must be strictly positive
Excluding only one integer for a floor denominatorA floor value persists over a whole step interval
Calling the domain of floor “the integers”That confuses integer outputs with real inputs
Joining simultaneous restrictions with “or”Every required operation must work at the same x

A quick endpoint substitution often catches more than another page of algebra. Test the boundary in the original expression, not in a simplified version that may have lost a restriction.

Try These Eight Domain Questions

Find the largest real domain of each expression before looking at the answers.

  1. (x^2 - 25)/(x - 5)
  2. 1/(abs(x + 2) - 4)
  3. ln(9 - x^2)
  4. 1/ln(x - 2)
  5. 1/(floor(x) + 2)
  6. sqrt(floor(x) - 2)
  7. ln(abs(x) - 2)
  8. sqrt(6 - x)/floor(x - 1)

Answers With the Key Step

  1. R except {5}. The original denominator excludes 5 even though the fraction simplifies to x + 5 elsewhere.
  2. R except {-6, 2}. Solve abs(x + 2) = 4 to locate the two forbidden denominator values.
  3. (-3, 3). The argument condition is 9 - x^2 > 0, or x^2 < 9.
  4. (2, 3) union (3, infinity). Require x - 2 > 0 and x - 2 != 1.
  5. (-infinity, -2) union [-1, infinity). The forbidden step is floor(x) = -2, which means -2 <= x < -1.
  6. [2, infinity). Require floor(x) >= 2. At x = 2, the square root is zero and is allowed.
  7. (-infinity, -2) union (2, infinity). Require abs(x) > 2, giving two outer intervals.
  8. (-infinity, 1) union [2, 6]. The root requires x <= 6; the denominator excludes 1 <= x < 2. Both 2 and 6 work in the original expression.

If your answer differs, first compare excluded points and brackets. A correct inequality with one incorrect endpoint is still a different set.

Frequently Asked Questions

1. What is the fastest reliable way to find a domain?

Scan the original expression for denominators, roots and logarithms. Record their conditions, check any nested expressions, and intersect the allowed sets. Leave simplification until after you have noted the restrictions it could hide.

2. Is the domain of every rational function all real numbers except zero?

No. Exclude the actual zeros of its denominator. For 1/(x - 7), exclude 7. For 1/(x^2 + 7), no real number is excluded.

3. Why does cancelling a factor not add an input back?

Cancellation establishes equal values only where the original fraction is defined. At a cancelled denominator zero, the original expression still involves division by zero unless the function is separately redefined at that point.

4. Does a modulus function require x to be nonnegative?

No. abs(x) accepts every real x. Its outputs are nonnegative. Restrictions arise from other operations, such as division inside the modulus or a square root around it.

5. Can the value of a logarithm be zero or negative?

Yes. ln(1) = 0, and ln(x) is negative for 0 < x < 1. The argument must be positive; the output does not have to be. If the logarithm is in a denominator, its zero output must then be excluded.

6. What extra checks are needed for a variable logarithm base?

Check that the argument is positive, the base is positive, and the base is not 1. Any expressions used to construct the argument and base must also be defined.

7. Is the domain of the greatest integer function the set of integers?

No. Its usual domain is all real numbers. The output is an integer. For example, the noninteger input 4.8 gives floor(4.8) = 4.

8. How do I find where a floor denominator becomes zero?

Solve for the forbidden floor value, then convert it into an interval. If floor(g(x)) - n = 0 for an integer n, solve n <= g(x) < n + 1 and exclude those inputs, while retaining any restrictions needed for g itself to exist.

9. Should I use union or intersection in a domain answer?

Use intersection when combining conditions that must hold together. Use union when writing the separate allowed pieces of the final set, such as (-infinity, 0) union (0, infinity) for 1/x.

10. Can a mixed expression have an empty real domain?

Yes. Its conditions may contradict each other. If one part needs x >= 4 and another needs x < 3, there is no valid real input. Always check that the conditions overlap before writing an interval answer.

Looking for commerce tuitions?

Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.

Start classes