Mathematics

Domain And Range: Formula, Rules & Examples

Domain and range describe the valid inputs and possible outputs of a function.

The domain is the set of values that can be used as inputs.

The range is the set of values the function can produce as outputs.

For a function:

y = f(x)

you can think of the relationship as:

Domain = Allowed x-values

Range = Possible y-values

For example:

f(x) = x²

accepts every real value of x, so:

Domain = All real numbers

Because squares cannot be negative:

Range = y ≥ 0

or in interval notation:

Range = [0, ∞)

Finding domain and range requires understanding both the algebraic restrictions in a function and the values its graph or formula can actually produce.

What Is Domain?

The domain of a function is the collection of all allowed inputs.

If:

f(x) = 2x + 3

any real number can be substituted for x.

There are no denominators that could become zero, no even roots requiring nonnegative radicands, and no logarithms requiring positive inputs.

Therefore:

Domain = All real numbers

In interval notation:

Domain = (-∞, ∞)

What Is Range?

The range is the collection of all possible outputs.

For:

f(x) = 2x + 3

every real output is possible.

For any desired output y, solve:

y = 2x + 3

for x:

x = (y – 3)/2

Every real y produces a real x.

Therefore:

Range = (-∞, ∞)

Domain and Range Formula

There is no single formula that produces the domain and range of every function.

Instead, use a systematic process.

For the domain:

Domain = All input values for which the function is defined

For the range:

Range = All output values produced by valid domain inputs

The restrictions depend on the type of function.

Common domain checks include:

Denominator ≠ 0

Even-root radicand ≥ 0

Logarithm argument > 0

Inner function output must belong to the outer function’s domain

The broader function notation framework helps make the input-output structure explicit.

Domain and Range Example

Consider:

f(x) = √(x – 2)

For a real square root:

x – 2 ≥ 0

Therefore:

x ≥ 2

So:

Domain = [2, ∞)

A square root produces nonnegative outputs:

f(x) ≥ 0

Therefore:

Range = [0, ∞)

Interval Notation Basics

Interval notation provides a compact way to express domain and range.

Use parentheses when an endpoint is excluded:

(a, b)

Use brackets when an endpoint is included:

[a, b]

Infinity always uses parentheses:

(-∞, 5]

[2, ∞)

because infinity is not a finite endpoint that can be included.

All Real Numbers in Interval Notation

The set of all real numbers is:

(-∞, ∞)

This is common for linear and polynomial functions.

For example:

f(x) = x³ – 2x + 1

has:

Domain = (-∞, ∞)

A cubic polynomial can also produce every real output, so in this case:

Range = (-∞, ∞)

Domain From an Equation

Suppose:

f(x) = 1/(x – 5)

The denominator cannot equal zero:

x – 5 ≠ 0

Therefore:

x ≠ 5

Domain:

(-∞, 5) ∪ (5, ∞)

This is the basic domain restriction found throughout rational expressions.

Range of 1/(x – 5)

Consider:

y = 1/(x – 5)

The numerator is always 1, so the function can never equal zero.

Therefore:

y ≠ 0

Range:

(-∞, 0) ∪ (0, ∞)

The excluded domain value is 5.

The excluded range value is 0.

Domain and range restrictions do not have to be the same.

Domain of a Rational Function

For a rational function:

f(x) = P(x)/Q(x)

the denominator must satisfy:

Q(x) ≠ 0

Therefore:

Domain = All real x-values except values that make Q(x) = 0

Example:

f(x) = (x + 1)/(x² – 9)

Factor the denominator using the difference of squares:

x² – 9 = (x – 3)(x + 3)

So:

x ≠ 3

and:

x ≠ -3

Domain:

(-∞, -3) ∪ (-3, 3) ∪ (3, ∞)

Canceled Factors Still Affect Domain

Consider:

f(x) = (x² – 9)/(x – 3)

Factor:

f(x) = [(x – 3)(x + 3)]/(x – 3)

The simplified expression is:

x + 3

but the original function was undefined at:

x = 3

Therefore:

Domain = All real numbers except 3

The graph behaves like:

y = x + 3

with a hole at the point corresponding to x = 3.

Simplification does not restore an input that was invalid in the original function.

Domain of a Square-Root Function

For real-valued:

f(x) = √g(x)

the radicand must satisfy:

g(x) ≥ 0

Example:

f(x) = √(x + 4)

Requirement:

x + 4 ≥ 0

Therefore:

x ≥ -4

Domain:

[-4, ∞)

This restriction also appears when solving radical equations.

Domain of √(5 – x)

Consider:

f(x) = √(5 – x)

Require:

5 – x ≥ 0

Then:

-x ≥ -5

Reverse the inequality when multiplying by -1:

x ≤ 5

Therefore:

Domain = (-∞, 5]

The function’s outputs remain nonnegative, so:

Range = [0, ∞)

Even Roots vs. Odd Roots

For real-valued even roots:

√x

⁴√x

the radicand must be nonnegative.

For odd roots:

∛x

negative values are allowed.

Therefore:

f(x) = ∛x

has:

Domain = (-∞, ∞)

and:

Range = (-∞, ∞)

This is an important distinction.

Domain of a Logarithmic Function

For a real logarithm:

f(x) = log(g(x))

the argument must satisfy:

g(x) > 0

not merely:

g(x) ≥ 0

For:

f(x) = log(x – 3)

require:

x – 3 > 0

Therefore:

x > 3

Domain:

(3, ∞)

The same restriction is essential when solving a logarithmic equation.

Range of a Basic Logarithmic Function

For:

f(x) = log(x)

with an appropriate positive logarithmic base not equal to 1:

Domain = (0, ∞)

The logarithm can produce arbitrarily large positive or negative real outputs.

Therefore:

Range = (-∞, ∞)

Domain of an Exponential Function

A standard exponential function:

f(x) = aˣ

with:

a > 0

and:

a ≠ 1

accepts every real exponent.

Therefore:

Domain = (-∞, ∞)

Its outputs are always positive:

aˣ > 0

Therefore:

Range = (0, ∞)

These restrictions remain important when working with an exponential equation.

Shifted Exponential Range

Consider:

f(x) = 2ˣ + 5

Since:

2ˣ > 0

we have:

2ˣ + 5 > 5

Therefore:

Domain = (-∞, ∞)

Range = (5, ∞)

The vertical shift changes the range but not the domain.

Domain of a Polynomial Function

Every polynomial function has domain:

(-∞, ∞)

Examples include:

f(x) = x² + 3x – 1

f(x) = x³ – 4x

f(x) = 5x⁶ + 2x² – 7

No finite real input causes ordinary polynomial addition, subtraction, multiplication, or nonnegative integer powers to become undefined.

The polynomial equation page focuses on solving equations involving these expressions rather than determining their full function ranges.

Range of a Linear Function

For a nonconstant linear function:

f(x) = mx + b

with:

m ≠ 0

both domain and range are:

(-∞, ∞)

The related linear equation can be solved for any real output because the nonzero slope allows the equation to be inverted.

Range of a Constant Function

Consider:

f(x) = 7

Domain:

(-∞, ∞)

Range:

{7}

No matter what input is used, the output is always 7.

This is a useful reminder that an unrestricted domain does not imply an unrestricted range.

Domain and Range of x²

For:

f(x) = x²

any real input is allowed:

Domain = (-∞, ∞)

But:

x² ≥ 0

for every real x.

Therefore:

Range = [0, ∞)

Graphically, the parabola has a minimum at:

y = 0

Domain and Range of -x²

For:

f(x) = -x²

domain remains:

(-∞, ∞)

Because:

-x² ≤ 0

the outputs cannot exceed zero.

Therefore:

Range = (-∞, 0]

The parabola opens downward and has a maximum at zero.

Range of a Shifted Quadratic

Consider:

f(x) = (x – 3)² + 2

Because:

(x – 3)² ≥ 0

we have:

f(x) ≥ 2

Therefore:

Domain = (-∞, ∞)

Range = [2, ∞)

The minimum occurs at the vertex:

(3, 2)

Finding Quadratic Range by Completing the Square

Suppose:

f(x) = x² – 6x + 11

Complete the square:

f(x) = (x² – 6x + 9) + 2

f(x) = (x – 3)² + 2

Since the squared expression is nonnegative:

f(x) ≥ 2

Therefore:

Range = [2, ∞)

The domain remains all real numbers.

Discriminant Method for Quadratic Range

The discriminant can also help determine the range of a quadratic.

Suppose:

y = x² – 6x + 11

Rearrange as an equation in x:

x² – 6x + (11 – y) = 0

For real x, the discriminant must satisfy:

D ≥ 0

Calculate:

D = (-6)² – 4(1)(11 – y)

D = 36 – 44 + 4y

D = 4y – 8

Require:

4y – 8 ≥ 0

Therefore:

y ≥ 2

So:

Range = [2, ∞)

This is an advanced but useful connection between domain-and-range analysis and root classification.

Factoring Quadratics and Domain Restrictions

Suppose:

f(x) = 1/(x² – 5x + 6)

To find the domain, factor the denominator using factoring quadratics:

x² – 5x + 6 = (x – 2)(x – 3)

The denominator is zero at:

x = 2

and:

x = 3

Therefore:

Domain = (-∞, 2) ∪ (2, 3) ∪ (3, ∞)

Factoring helps reveal excluded inputs quickly.

Domain of a Composite Function

For:

f(g(x))

the input must satisfy two conditions:

x must belong to the domain of g

and:

g(x) must belong to the domain of f

A rule is:

Domain of f(g(x)) = Inputs allowed by g that also make g(x) a valid input for f

This is central to the composite function page.

Composite Function Example

Suppose:

f(x) = √x

and:

g(x) = x – 4

Then:

f(g(x)) = √(x – 4)

The inner function allows every real input.

But the outer square-root function requires:

x – 4 ≥ 0

Therefore:

Domain = [4, ∞)

Composite Function With a Denominator

Let:

f(x) = 1/x

and:

g(x) = x² – 9

Then:

f(g(x)) = 1/(x² – 9)

Require:

x² – 9 ≠ 0

Using the difference of squares:

(x – 3)(x + 3) ≠ 0

Therefore:

x ≠ -3, 3

Domain:

(-∞, -3) ∪ (-3, 3) ∪ (3, ∞)

Domain and Range of an Absolute Value Function

Consider:

f(x) = |x|

Every real input is valid:

Domain = (-∞, ∞)

Absolute value is never negative:

|x| ≥ 0

Therefore:

Range = [0, ∞)

The absolute value equation page focuses on solving equations involving this distance relationship.

Shifted Absolute Value Function

Consider:

f(x) = |x – 2| + 4

Absolute value satisfies:

|x – 2| ≥ 0

Therefore:

f(x) ≥ 4

So:

Domain = (-∞, ∞)

Range = [4, ∞)

The graph has its minimum at:

(2, 4)

Domain and Range of a Piecewise Function

A piecewise function can have different rules over different portions of its domain.

Suppose:

f(x) = x + 1 for x < 0

f(x) = x² for x ≥ 0

The domain combines:

x < 0

and:

x ≥ 0

so:

Domain = (-∞, ∞)

To determine the range, analyze the outputs of both pieces and combine them.

The first piece produces:

y < 1

The second produces:

y ≥ 0

Together they cover:

(-∞, ∞)

Domain and Range From a Graph

When a function is given graphically:

Domain is read from left to right.

Ask:

Which x-values does the graph occupy?

Range is read from bottom to top.

Ask:

Which y-values does the graph occupy?

Open circles usually mean an endpoint or point is excluded.

Closed circles usually mean it is included.

Arrows indicate that the graph continues.

Graph Example

Suppose a graph begins at a closed point:

(-2, 1)

and continues indefinitely to the right while remaining at or above:

y = 1

Then:

Domain = [-2, ∞)

and, if all values at or above 1 occur:

Range = [1, ∞)

The actual range depends on the graph’s vertical behavior, not simply its starting point.

Open vs. Closed Endpoints

If:

x > 3

then interval notation is:

(3, ∞)

because 3 is excluded.

If:

x ≥ 3

then:

[3, ∞)

because 3 is included.

The same rule applies when writing range restrictions.

Union Symbol in Domain and Range

When separate intervals are allowed, use:

which means union.

For example:

x ≠ 2

becomes:

(-∞, 2) ∪ (2, ∞)

For:

x ≠ -1, 4

the domain is:

(-∞, -1) ∪ (-1, 4) ∪ (4, ∞)

Set-Builder Notation

Domain and range can also be written with conditions.

For example:

Domain = {x | x ≠ 3}

means:

All x such that x is not equal to 3

For a square root:

Domain = {x | x ≥ -4}

Set-builder notation can be more convenient when the restriction is easier to describe algebraically than through intervals.

Domain of a Rational Equation vs. Function

The domain restriction in a rational equation plays a similar role.

Suppose:

1/(x – 2) = 3

Before solving, record:

x ≠ 2

The function:

f(x) = 1/(x – 2)

has the same domain restriction.

Equation solving finds specific valid values.

Domain analysis identifies all values for which the expression is defined.

Domain of an Exponential Equation

Consider:

2ˣ = x + 5

The exponential expression:

is defined for every real x.

The linear expression is also defined for every real x.

Therefore no domain values are excluded by the expressions themselves.

Solving the exponential equation is a separate problem from establishing its domain.

Domain and Range of Direct Variation

A direct variation has the form:

y = kx

For an unrestricted real-valued model with:

k ≠ 0

we have:

Domain = (-∞, ∞)

Range = (-∞, ∞)

In a practical application, however, negative inputs may not make sense.

For example:

Total Cost = Unit Price × Quantity

may require:

Quantity ≥ 0

The practical domain can therefore differ from the broad algebraic domain.

Domain Depends on Context

Suppose:

C = 15x

Mathematically, any real x can be used.

But if x represents the number of tickets sold, an appropriate practical domain could be:

x = 0, 1, 2, 3, …

If fractional tickets are impossible, even:

x = 2.5

would be excluded by the context.

Domain is therefore not always determined solely by symbolic algebra.

Range Also Depends on Context

For:

C = 15x

with nonnegative whole-number ticket quantities:

possible outputs are:

0, 15, 30, 45, …

rather than every real number.

The real-world meaning of the variables can therefore impose discrete domain and range values.

Finding Range Algebraically

One general method for finding range is:

  1. Write:

y = f(x)

  1. Solve the equation for x.
  2. Determine which y values allow a valid real x.

For example:

y = √(x – 2)

Solve:

y² = x – 2

x = y² + 2

Because the original square-root function requires:

y ≥ 0

the range is:

[0, ∞)

The algebraic inversion alone is not enough; original function behavior must also be respected.

Range of 1/x Algebraically

Let:

y = 1/x

Solve for x:

xy = 1

x = 1/y

This requires:

y ≠ 0

Therefore:

Range = (-∞, 0) ∪ (0, ∞)

This mirrors the original domain restriction:

x ≠ 0

for the reciprocal function.

Domain and Range of Inverse Functions

For an inverse function, the original function’s domain and range exchange roles.

If:

f: Domain → Range

then:

f⁻¹: Range → Domain

For example:

f(x) = x³

has:

Domain = (-∞, ∞)

Range = (-∞, ∞)

Its inverse:

f⁻¹(x) = ∛x

has the same sets.

For functions with restricted ranges, this exchange becomes especially important.

Example of Domain-Range Swap

Consider:

f(x) = x²

restricted to:

x ≥ 0

Then:

Domain of f = [0, ∞)

Range of f = [0, ∞)

Its inverse is:

f⁻¹(x) = √x

which also has:

Domain = [0, ∞)

Range = [0, ∞)

The restriction on the original quadratic is necessary to make it one-to-one.

Range and Horizontal Asymptotes

A horizontal asymptote can sometimes indicate a value excluded from the range.

For:

f(x) = 2ˣ

the horizontal asymptote is:

y = 0

The function approaches zero but never reaches it.

Therefore:

Range = (0, ∞)

For:

f(x) = 2ˣ + 3

the asymptote is:

y = 3

and:

Range = (3, ∞)

Domain and Vertical Asymptotes

A vertical asymptote commonly occurs at an excluded domain value.

For:

f(x) = 1/(x – 4)

the denominator is zero at:

x = 4

Therefore:

x = 4

is excluded from the domain and is also the vertical asymptote.

Domain analysis and graph behavior reinforce each other.

Domain and Range With Multiple Restrictions

Consider:

f(x) = √(x – 1)/(x – 5)

The square root requires:

x – 1 ≥ 0

so:

x ≥ 1

The denominator requires:

x ≠ 5

Combine the conditions:

Domain = [1, 5) ∪ (5, ∞)

When several restrictions exist, all must be satisfied simultaneously.

Another Multiple-Restriction Example

Consider:

f(x) = 1/√(x – 3)

Because the square root is in the denominator, two restrictions combine.

The radicand must be nonnegative:

x – 3 ≥ 0

but the denominator cannot equal zero:

√(x – 3) ≠ 0

Therefore:

x – 3 > 0

so:

x > 3

Domain:

(3, ∞)

This is stricter than the ordinary square-root condition.

Domain and Factored Denominators

Consider:

f(x) = 1/(x² – 4x – 5)

Factor:

x² – 4x – 5 = (x – 5)(x + 1)

Therefore:

x ≠ 5

x ≠ -1

Domain:

(-∞, -1) ∪ (-1, 5) ∪ (5, ∞)

Factoring is often the fastest way to locate all denominator restrictions.

Can the Discriminant Help Find a Rational Function’s Range?

Yes, in some cases.

Consider:

y = 1/(x² + 1)

Rearrange:

y(x² + 1) = 1

yx² + y – 1 = 0

Treat this as a quadratic equation in x.

For real x, its discriminant must be nonnegative.

Here:

A = y

B = 0

C = y – 1

So:

D = 0² – 4y(y – 1)

D = 4y(1 – y)

For real solutions:

y(1 – y) ≥ 0

which gives:

0 ≤ y ≤ 1

But the original function never equals zero:

1/(x² + 1) > 0

Therefore:

Range = (0, 1]

The discriminant can be a powerful range-finding method when solving explicitly for x is difficult.

Domain and Range of Complex-Valued Functions

Domain and range can also be defined for complex numbers, but the sets may involve regions of the complex plane rather than ordinary real intervals.

For introductory real-function problems, interval notation is normally used because both inputs and outputs are real.

Complex-domain analysis is a broader subject and should not be confused with routine real-number domain restrictions.

Common Domain Restrictions Summary

For common real-valued functions:

Polynomial → Usually all real inputs

Rational function → Denominator ≠ 0

Even root → Radicand ≥ 0

Even root in denominator → Radicand > 0

Logarithm → Argument > 0

Standard exponential → All real inputs

Composite function → Inner input valid and inner output valid for outer function

These rules handle a large proportion of introductory domain problems.

Common Range Patterns Summary

Typical ranges include:

Nonconstant linear function → All real numbers

x² → [0, ∞)

-x² → (-∞, 0]

√x → [0, ∞)

aˣ → (0, ∞), for a > 0 and a ≠ 1

log(x) → All real numbers

1/x → All real numbers except 0

Transformations can shift, stretch, reflect, or otherwise change these ranges.

Domain and Range Rules

These formulas and rules are:

Domain = All valid input values

Range = All possible output values

Rational Function Rule: Denominator ≠ 0

Square-Root Rule: Radicand ≥ 0

Square Root in Denominator: Radicand > 0

Logarithm Rule: Argument > 0

Composite Domain: x must be valid for g(x), and g(x) must be valid for f

All Real Numbers: (-∞, ∞)

No raw LaTeX or special mathematics plugin is required.

Common Domain and Range Mistakes

A common mistake is finding only denominator restrictions and ignoring radicals or logarithms.

Another is using:

Radicand > 0

for every square root. A square root outside a denominator allows zero:

Radicand ≥ 0

Students also sometimes allow zero inside a logarithm, even though:

log(0)

is undefined in the real-number system.

Another mistake is simplifying a rational function and forgetting restrictions from canceled factors.

Domain and range are frequently confused: domain concerns inputs, while range concerns outputs.

When reading a graph, domain should be read horizontally and range vertically.

Infinity should never be written with a closed bracket.

Finally, the algebraic domain of a formula may be broader than the meaningful domain of a real-world application.

Frequently Asked Questions

What is domain in simple terms?

Domain is the set of all input values that a function is allowed to accept.

What is range in simple terms?

Range is the set of all output values that the function can produce.

What is the difference between domain and range?

Domain = Inputs

Range = Outputs

What is the domain of a polynomial?

For an ordinary polynomial function:

Domain = (-∞, ∞)

What is the domain of 1/x?

Because:

x ≠ 0

the domain is:

(-∞, 0) ∪ (0, ∞)

What is the range of 1/x?

The function can never equal zero, so:

Range = (-∞, 0) ∪ (0, ∞)

What is the domain of √x?

For real outputs:

x ≥ 0

Therefore:

Domain = [0, ∞)

What is the range of √x?

Range = [0, ∞)

What is the rule for a square root?

Radicand ≥ 0

for a real square-root function.

What if the square root is in a denominator?

Then:

Radicand > 0

because the denominator cannot equal zero.

What is the domain rule for logarithms?

Logarithm Argument > 0

What is the domain of an exponential function?

A standard function such as:

f(x) = 2ˣ

has:

Domain = (-∞, ∞)

What is the range of an exponential function?

For:

f(x) = aˣ

with a > 0 and a ≠ 1:

Range = (0, ∞)

How do you find domain from a graph?

Read the set of x-values covered by the graph from left to right.

How do you find range from a graph?

Read the set of y-values covered by the graph from bottom to top.

What do open and closed circles mean?

An open circle generally means the point is excluded.

A closed circle generally means the point is included.

Why are infinity symbols always used with parentheses?

Infinity is not a finite endpoint that can be included as an element of an interval.

How do you find the domain of a rational function?

Find every value that makes the denominator zero and exclude those values.

How do you find the domain of a composite function?

The input must be valid for the inner function, and the inner function’s output must be allowed by the outer function.

Can factoring help find domain?

Yes. Factoring a denominator can reveal every excluded input value.

Can the discriminant help find range?

Yes. If an equation can be rearranged as a quadratic in x, requiring its discriminant to be nonnegative can identify which y values produce real inputs.

Can context restrict domain and range?

Yes. A formula may permit all real values algebraically while a real-world quantity such as people, units, time, or physical measurements may require a smaller set.

Why are domain and range important?

Domain and range identify where a function is mathematically valid and what outputs it can produce. They are essential for understanding formulas, graphs, inverse functions, composite functions, rational expressions, radicals, logarithms, exponentials, and mathematical models.

Mehran Khan

Mehran Khan is the primary author at The Logic Library and CEO & Founder of One Digit Media. With 10+ years of experience in software engineering, SEO, and digital publishing, he uses a research-led approach to Logics, Maths, Tech, Formulas, Science, and AI.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button