 Open in App
Not now

# How to Find the Domain and Range of a Function?

• Last Updated : 17 Oct, 2022

A function is defined as the relation between a set of inputs and their outputs, where the input can have only one output. It depicts a relationship between an independent variable and a dependent variable. A function is usually denoted by y = f(x), where x is the input. A function is a relation f from a set X to another set Y, where each element in X has exactly one output in Y, and it is represented as f: X→Y. Here the set X is known as the domain of a function, and the set Y is called the co-domain of the function. Every function has a domain, codomain, and range that help in defining the function.

## Domain, Co-Domain, and Range of a Function

The domain of a function is defined as the set of all possible values for which the function can be defined. A co-domain of a function is the set of possible outcomes, whereas a range or image of a function is a subset of a co-domain and is the set of images of the elements in the domain. For example, in the figure given below, f(x) = x3 is a function whose domain is the set X, and its co-domain is the set Y while its range is {1, 8, 27, 64}. For the given function f(x) = x3:

• Domain = {1, 2, 3, 4}
• Co-domain = {1, 2, 3, 4, 8, 9, 16, 23, 27, 64}
• f(x) = {(1,1), (2,8), (3,27), (4,64)}
• Range = {1, 8, 27, 64}

## Domain

The domain of a function is defined as the set of all possible values for which the function can be defined. Let us go through the domains of different functions.

• The domain of any polynomial function such as a linear function, quadratic function, cubic function, etc. is a set of all real numbers (R).
• The domain of a logarithmic function f(x) = log x is x > 0 or (0, ∞).
• The domain of a square root function f(x) = √x is the set of non-negative real numbers which is represented as [0, ∞).
• The domain of an exponential function is the set of all real numbers (R).
• A rational function is defined only for non-zero values of its denominator. So, to determine the domain of a rational function y = f(x), set the denominator ≠ 0.

## How to Find the Domain of a Function?

To find the domain of a function, use  the following steps:

Step 1: First, check whether the given function can include all real numbers.

Step 2: Then check whether the given function has a non-zero value in the denominator of the fraction and a non-negative real number under the denominator of the fraction.

Step 3: In some cases, the domain of a function is subjected to certain restrictions, i.e., these restrictions are the values where the given function cannot be defined. For example, the domain of a function f(x) = 2x + 1 is the set of all real numbers (R), but the domain of the function f(x) = 1/ (2x + 1) is the set of all real numbers except -1/2.

Step 4: Sometimes, the interval at which the function is defined is mentioned along with the function. For example, f (x) = 2x2 + 3, -5 < x < 5. Here, the input values of x are between -5 and 5. As a result, the domain of f(x) is (-5, 5).

After taking all the steps discussed above the set of numbers left with us is considered the domain of a function.

## How to Find the Range of a Function?

The range or image of a function is a subset of a co-domain and is the set of images of the elements in the domain.

To find the range of a function use the following steps

Let us consider a function y = f(x).

Step 1: Write the given function in its general representation form, i.e., y = f(x).

Step 2: Solve it for x and write the obtained function in the form of x = g(y).

Step 3: Now, the domain of the function x = g(y) will be the range of the function y = f(x).

Thus, the range of a function is calculated.

Example: Find the range of the function f(x) = 1/ (4x − 3).

Solution:

Given: f(x) = 1/ (4x − 3).

Let y = 1/ (4x − 3).

4xy − 3y = 1

4xy = 1 + 3y

x = 4y / (1 + 3y)

Here, x is defined only when y is not equal to −1/3.

So, the range of f(x) = 1/ (4x − 3) is (−∞, −1/3) U (1, ∞).

## Solved Example on Domain and Range

Example 1: Find the domain of a function f(x) = (2x + 1)/ (x2 − 4x + 3).

Solution:

Given: f(x) = (2x + 1)/ (x2 − 4x + 3)

f(x) = (2x + 1)/ (x − 1)(x − 3)

We know that the domain of a function is defined as the set of all possible values for which the function can be defined.

Here, the given function is a rational function that is defined only for non-zero values of its denominator.

So, (x − 1)(x − 3) ≠ 0

x − 1 ≠ 0 and x − 3 ≠ 0

x ≠ 1 and x ≠ 3

Domain = R − {1, 3}

Hence, the domain of the given function is x ∈ R − {1, 3}.

Example 2: Find the domain and range of a function f(x) = x2 + 1.

Solution:

Given: f(x) = x2 + 1

We know that the domain of a function is defined as the set of all possible values for which the function can be defined.

Here, the given function has no undefined values of x.

So, for the given function, the domain is the set of all real numbers.

Thus, the Domain of f(x) = (-∞, ∞)

While the range of a function is the set of images of the elements in the domain.

Let y = x2 + 1

x2 = y − 1

x = √(y − 1)

We know that a square root function is defined for non-negative values.

So, √(y − 1) ≥ 0

This is possible when y is greater than y ≥ 1.

Therefore, the range of f(x) is [1, ∞).

Example 3: Find the domain and range of a function f(x) = (x + 2)/ (x – 3).

Solution:

Given: f(x) = (x + 2)/ (x – 3)

We know that the domain of a function is defined as the set of all possible values for which the function can be defined.

Here, the given function is a rational function that is defined only for non-zero values of its denominator.

The given function is not defined when x – 3 = 0, i.e., x = 3

So, the domain of f(x) is the set of all real numbers except 3, i.e., (-∞, 3) U (3, ∞)

While the range of a function is the set of images of the elements in the domain.

Let y = (x + 2)/ (x – 3)

xy – 3y = x + 2

xy – x = 3y + 2

x (y – 1) = 3y + 2

x = (3y + 2)/ (y – 1)

Here, x is defined only when y is not equal to 1.

Therefore, the range of the given function is (-∞, 1) U (1, ∞).

Example 4: Find the domain for which the functions f(x) = 5x2 − 7x + 2 and g(x) = 2x2 + x − 6 are equal.

Solution:

Given: f(x) = 5x2 − 7x + 2,

g(x) = 2x2 + x − 6, and f(x) = g(x).

From the given data,

f(x) = g(x)

5x2 − 7x + 2 = 2x2 + x − 6

3x2 − 8x + 4 = 0

3x2 − 6x − 2x + 4 = 0

3x (x − 2) − 2(x − 2) = 0

(3x − 2) (x − 2) = 0

x = 2/3 or 2

So, if the value of x is 2/3 or 2, then the functions f(x) and g(x) will be equal.

Hence, the domain for which the functions f(x) and g(x) are equal is {2/3, 2}.

Example 5: Find the domain and range of a function f(x) = 3ex/7.

Solution:

Given: f(x) = 3ex/7.

The given function is an exponential function.

We know that the domain of an exponential function is the set of all real numbers (R).

So, the domain of f(x) = 3ex/7 is R.

Let y = 3ex/7

ex = 7y/3

x = loge(7y/3)

Here, x is defined only when y > 0.

Hence, the range of f(x) = 3ex/7 is (0, ∞).

## FAQs on Domain and Range

Question 1: Define a function.

In mathematics, a function is defined as the relation between a set of inputs and their outputs, where the input can have only one output.

Question 2: How is a function represented in mathematics?

A function is a relation f from a set X to another set Y, where each element in X has exactly one output in Y, and it is represented as f: X→Y. A function is usually denoted by y = f(x), where x is the input.

Question 3: Define the domain and give an example.

The domain of a function is defined as the set of all possible values for which the function can be defined. The domain of any polynomial function such as a linear function, quadratic function, cubic function, etc. is a set of all real numbers (R).

Question 4: Define the co-domain and range of a function.