In this section we present a collection of 20 practice problems on domain, codomain, and range, developed with rigorous and detailed explanations to truly understand the meaning of these three fundamental concepts in the study of functions.
The domain, codomain, and range are often confused with one another, yet they represent distinct sets and play entirely different roles.
Specifically:
- the domain is the set of values for which the function is defined;
- the codomain is the set into which the function maps its values;
- the range is the set of values actually attained by the function.
A thorough understanding of this distinction is essential not only in the elementary study of functions, but also in real analysis, in the study of invertible functions, linear maps, and geometric transformations.
In the exercises that follow, we will learn to:
- correctly determine the domain of a function;
- distinguish between the codomain and the range;
- understand when the range and the codomain coincide;
- investigate the values actually attained by a function.
Exercise 1 — level ★☆☆☆☆
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=5x-3. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=\mathbb{R} \]
Solution
The given function is:
\[ f(x)=5x-3. \]
This is a first-degree polynomial function. Polynomial functions are defined for every real number, since there are no denominators, radicals, or logarithms that could impose any restrictions.
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
From the notation:
\[ f:\mathbb{R}\to\mathbb{R} \]
we immediately see that the chosen codomain is:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range of the function.
Set:
\[ y=5x-3. \]
Solving for \(x\):
\[ 5x=y+3 \]
and so:
\[ x=\frac{y+3}{5}. \]
For every real number \(y\), the value:
\[ \frac{y+3}{5} \]
belongs to \(\mathbb{R}\). This means that every real number is actually attained by the function.
Consequently:
\[ \mathrm{Im}(f)=\mathbb{R}. \]
Exercise 2 — level ★☆☆☆☆
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=x^2+1. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[1,+\infty) \]
Solution
The function:
\[ f(x)=x^2+1 \]
is a polynomial function and is therefore defined for every real number.
Consequently:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
The codomain is read directly from the definition of the function:
\[ f:\mathbb{R}\to\mathbb{R}. \]
Therefore:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
Since:
\[ x^2\ge0 \qquad \forall x\in\mathbb{R}, \]
it follows that:
\[ x^2+1\ge1. \]
The function therefore takes only values greater than or equal to \(1\).
We now show that all such values are indeed attained.
Let:
\[ y\ge1. \]
Solving:
\[ y=x^2+1. \]
We obtain:
\[ x^2=y-1. \]
Since:
\[ y-1\ge0, \]
we may choose:
\[ x=\sqrt{y-1}. \]
Thus every number greater than or equal to \(1\) belongs to the range of the function.
Therefore:
\[ \mathrm{Im}(f)=[1,+\infty). \]
Finally, we note that:
\[ \mathrm{Im}(f)\subsetneq\mathrm{Cod}(f), \]
since the function never takes values less than \(1\).
Exercise 3 — level ★☆☆☆☆
Consider the function:
\[ f:\mathbb{R}\to[0,+\infty) \qquad,\qquad f(x)=x^2. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=[0,+\infty) \]
\[ \mathrm{Im}(f)=[0,+\infty) \]
Solution
The given function is:
\[ f(x)=x^2. \]
Being a polynomial function, it is defined for every real number.
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
The codomain, on the other hand, is:
\[ [0,+\infty), \]
since the function is defined as:
\[ f:\mathbb{R}\to[0,+\infty). \]
We now study the range.
For every \(x\in\mathbb{R}\), we have:
\[ x^2\ge0. \]
The function therefore takes only non-negative values.
Moreover, every non-negative value is indeed attained.
Indeed, given:
\[ y\ge0, \]
we may choose:
\[ x=\sqrt{y}. \]
We then obtain:
\[ f(x)=f(\sqrt{y})=(\sqrt{y})^2=y. \]
Hence:
\[ \mathrm{Im}(f)=[0,+\infty). \]
In this case, the range and the codomain coincide:
\[ \mathrm{Im}(f)=\mathrm{Cod}(f). \]
Exercise 4 — level ★★☆☆☆
Consider the function:
\[ f:[0,+\infty)\to\mathbb{R} \qquad,\qquad f(x)=\sqrt{x}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=[0,+\infty) \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[0,+\infty) \]
Solution
The given function is:
\[ f(x)=\sqrt{x}. \]
For a square root to be defined over the real numbers, the radicand must be greater than or equal to zero.
We must therefore require:
\[ x\ge0. \]
Consequently:
\[ \mathrm{Dom}(f)=[0,+\infty). \]
From the definition:
\[ f:[0,+\infty)\to\mathbb{R}, \]
we see that the chosen codomain is:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
The arithmetic square root is always non-negative.
Indeed, we have:
\[ \sqrt{x}\ge0 \qquad \forall x\ge0. \]
Thus the function takes only values belonging to the interval:
\[ [0,+\infty). \]
We now show that all such values are indeed attained.
Let:
\[ y\ge0. \]
Choose:
\[ x=y^2. \]
Since:
\[ y^2\ge0, \]
we have:
\[ y^2\in[0,+\infty), \]
so the chosen value belongs to the domain.
Moreover:
\[ f(y^2)=\sqrt{y^2}=y. \]
Thus every non-negative real number belongs to the range of the function.
Therefore:
\[ \mathrm{Im}(f)=[0,+\infty). \]
Finally, we note that:
\[ \mathrm{Im}(f)\subsetneq\mathrm{Cod}(f), \]
since the function never takes negative values.
Exercise 5 — level ★★☆☆☆
Consider the function:
\[ f:\mathbb{R}\setminus\{1\}\to\mathbb{R} \qquad,\qquad f(x)=\frac{2}{x-1}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{1\} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=\mathbb{R}\setminus\{0\} \]
Solution
The given function is:
\[ f(x)=\frac{2}{x-1}. \]
In a fraction, the denominator cannot equal zero.
We must therefore require:
\[ x-1\neq0. \]
Solving this gives:
\[ x\neq1. \]
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{1\}. \]
From the definition:
\[ f:\mathbb{R}\setminus\{1\}\to\mathbb{R}, \]
we deduce that:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range of the function.
First, we observe that the function can never take the value \(0\).
Indeed:
\[ \frac{2}{x-1}=0 \]
has no real solutions, since a fraction with a nonzero numerator cannot equal zero.
Therefore:
\[ 0\notin\mathrm{Im}(f). \]
We now show that every other real number is attained.
Let:
\[ y\in\mathbb{R}\setminus\{0\}. \]
Solving:
\[ y=\frac{2}{x-1}. \]
Multiplying by \(x-1\):
\[ y(x-1)=2. \]
Dividing by \(y\):
\[ x-1=\frac{2}{y}. \]
and so:
\[ x=1+\frac{2}{y}. \]
Since \(y\neq0\), this value is well defined.
Therefore every nonzero real number belongs to the range of the function.
Hence:
\[ \mathrm{Im}(f)=\mathbb{R}\setminus\{0\}. \]
Exercise 6 — level ★★☆☆☆
Consider the function:
\[ f:(0,+\infty)\to\mathbb{R} \qquad,\qquad f(x)=\ln(x). \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=(0,+\infty) \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=\mathbb{R} \]
Solution
The given function is:
\[ f(x)=\ln(x). \]
The natural logarithm is defined only for strictly positive arguments.
We must therefore require:
\[ x>0. \]
Therefore:
\[ \mathrm{Dom}(f)=(0,+\infty). \]
From the definition:
\[ f:(0,+\infty)\to\mathbb{R}, \]
we deduce that the codomain is:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
It is known that:
\[ \lim_{x\to0^+}\ln(x)=-\infty \]
and:
\[ \lim_{x\to+\infty}\ln(x)=+\infty. \]
Moreover, the logarithm function is continuous on the interval:
\[ (0,+\infty). \]
This means that as \(x\) ranges over all positive values, the function attains every real value.
Therefore:
\[ \mathrm{Im}(f)=\mathbb{R}. \]
In this case:
\[ \mathrm{Im}(f)=\mathrm{Cod}(f). \]
Exercise 7 — level ★★☆☆☆
Consider the function:
\[ f:[1,+\infty)\to\mathbb{R} \qquad,\qquad f(x)=\sqrt{x-1}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=[1,+\infty) \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[0,+\infty) \]
Solution
The given function is:
\[ f(x)=\sqrt{x-1}. \]
For the square root to be defined over the real numbers, the radicand must be greater than or equal to zero.
We must therefore require:
\[ x-1\ge0. \]
Solving:
\[ x\ge1. \]
Therefore:
\[ \mathrm{Dom}(f)=[1,+\infty). \]
From the definition:
\[ f:[1,+\infty)\to\mathbb{R}, \]
we read off the codomain:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
Since an arithmetic square root is always non-negative, we have:
\[ \sqrt{x-1}\ge0. \]
Therefore the function takes only non-negative values.
We now show that every non-negative value is indeed attained.
Let:
\[ y\ge0. \]
We want to find \(x\in[1,+\infty)\) such that:
\[ \sqrt{x-1}=y. \]
Squaring both sides:
\[ x-1=y^2. \]
From which:
\[ x=y^2+1. \]
Since \(y^2\ge0\), we have:
\[ y^2+1\ge1, \]
so the value found belongs to the domain.
Moreover:
\[ f(y^2+1)=\sqrt{y^2+1-1}=\sqrt{y^2}=y, \]
since \(y\ge0\).
Therefore the function attains precisely the non-negative values, and no others.
Hence:
\[ \mathrm{Im}(f)=[0,+\infty). \]
Exercise 8 — level ★★☆☆☆
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=|x|. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[0,+\infty) \]
Solution
The given function is:
\[ f(x)=|x|. \]
The absolute value is defined for every real number.
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
From the definition:
\[ f:\mathbb{R}\to\mathbb{R}, \]
we deduce that:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now study the range.
By definition of absolute value, for every \(x\in\mathbb{R}\) we have:
\[ |x|\ge0. \]
Therefore the function cannot take negative values.
Conversely, every non-negative value is attained.
Indeed, given:
\[ y\ge0, \]
it suffices to choose:
\[ x=y. \]
Then:
\[ f(x)=f(y)=|y|=y, \]
since \(y\ge0\).
The function thus takes precisely the non-negative values.
Therefore:
\[ \mathrm{Im}(f)=[0,+\infty). \]
Exercise 9 — level ★★★☆☆
Consider the function:
\[ f:\mathbb{R}\setminus\{-2\}\to\mathbb{R} \qquad,\qquad f(x)=\frac{x+1}{x+2}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{-2\} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=\mathbb{R}\setminus\{1\} \]
Solution
The given function is:
\[ f(x)=\frac{x+1}{x+2}. \]
In a rational function, the denominator cannot be zero.
We must therefore require:
\[ x+2\neq0. \]
From which:
\[ x\neq-2. \]
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{-2\}. \]
From the definition:
\[ f:\mathbb{R}\setminus\{-2\}\to\mathbb{R}, \]
we deduce that:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range of the function.
Set:
\[ y=\frac{x+1}{x+2}. \]
We solve for \(x\).
Multiplying both sides by \(x+2\):
\[ y(x+2)=x+1. \]
Expanding:
\[ yx+2y=x+1. \]
Collecting terms in \(x\) on one side:
\[ yx-x=1-2y. \]
Factoring out \(x\):
\[ x(y-1)=1-2y. \]
If:
\[ y\neq1, \]
we can divide by \(y-1\):
\[ x=\frac{1-2y}{y-1}. \]
This shows that every real number other than \(1\) is attained by the function.
We now examine the case:
\[ y=1. \]
This would require:
\[ \frac{x+1}{x+2}=1. \]
Multiplying by \(x+2\):
\[ x+1=x+2, \]
that is:
\[ 1=2, \]
which is a contradiction.
Therefore the value \(1\) is never attained by the function.
Hence:
\[ \mathrm{Im}(f)=\mathbb{R}\setminus\{1\}. \]
Exercise 10 — level ★★★☆☆
Consider the function:
\[ f:[-1,+\infty)\to\mathbb{R} \qquad,\qquad f(x)=x^2+2x. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=[-1,+\infty) \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[-1,+\infty) \]
Solution
The function:
\[ f(x)=x^2+2x \]
is a polynomial function and would therefore be defined for every real number.
However, the domain is already specified in the definition of the function:
\[ [-1,+\infty). \]
Therefore:
\[ \mathrm{Dom}(f)=[-1,+\infty). \]
The codomain is:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now study the range.
Completing the square:
\[ x^2+2x=(x+1)^2-1. \]
Since:
\[ (x+1)^2\ge0, \]
it follows that:
\[ (x+1)^2-1\ge-1. \]
Therefore:
\[ f(x)\ge-1. \]
Moreover, the value \(-1\) is actually attained at \(x=-1\), since:
\[ f(-1)=(-1)^2+2(-1)=1-2=-1. \]
We now show that all values greater than \(-1\) are also attained.
Let:
\[ y\ge-1. \]
Solving:
\[ y=(x+1)^2-1. \]
We obtain:
\[ y+1=(x+1)^2. \]
Since:
\[ y+1\ge0, \]
we can write:
\[ x+1=\sqrt{y+1}. \]
From which:
\[ x=-1+\sqrt{y+1}. \]
This value belongs to the interval:
\[ [-1,+\infty). \]
Therefore all values greater than or equal to \(-1\) are indeed attained by the function.
Hence:
\[ \mathrm{Im}(f)=[-1,+\infty). \]
Exercise 11 — level ★★★☆☆
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=-x^2+4. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=(-\infty,4] \]
Solution
The given function is:
\[ f(x)=-x^2+4. \]
This is a polynomial function and is therefore defined for every real number.
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
From the definition:
\[ f:\mathbb{R}\to\mathbb{R} \]
we see that the codomain is:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
Since:
\[ x^2\ge0 \qquad \forall x\in\mathbb{R}, \]
multiplying by \(-1\) reverses the direction of the inequality:
\[ -x^2\le0. \]
Adding \(4\) to both sides:
\[ -x^2+4\le4. \]
Therefore the function cannot take values greater than \(4\).
The maximum value \(4\) is actually attained at \(x=0\), since:
\[ f(0)=-0^2+4=4. \]
Furthermore, as \(|x|\) grows, the term \(-x^2\) becomes increasingly negative, so the function takes arbitrarily large negative values.
Therefore the range is:
\[ \mathrm{Im}(f)=(-\infty,4]. \]
Exercise 12 — level ★★★☆☆
Consider the function:
\[ f:\mathbb{R}\setminus\{0\}\to\mathbb{R} \qquad,\qquad f(x)=\frac{1}{x^2}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{0\} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=(0,+\infty) \]
Solution
The given function is:
\[ f(x)=\frac{1}{x^2}. \]
The denominator cannot equal zero, so we require:
\[ x^2\neq0. \]
This condition is equivalent to:
\[ x\neq0. \]
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{0\}. \]
From the definition:
\[ f:\mathbb{R}\setminus\{0\}\to\mathbb{R}, \]
it follows that:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now study the range.
For every \(x\neq0\), we have:
\[ x^2>0. \]
Consequently:
\[ \frac{1}{x^2}>0. \]
The function therefore takes only positive values.
We now show that every positive value is indeed attained.
Let:
\[ y>0. \]
We want to solve:
\[ \frac{1}{x^2}=y. \]
We obtain:
\[ x^2=\frac{1}{y}. \]
Since \(y>0\), the number \(\frac{1}{y}\) is positive, and we may therefore choose:
\[ x=\frac{1}{\sqrt{y}}. \]
This value is real and nonzero, so it belongs to the domain.
Moreover:
\[ f\left(\frac{1}{\sqrt{y}}\right) = \frac{1}{\left(\frac{1}{\sqrt{y}}\right)^2} = \frac{1}{\frac{1}{y}} = y. \]
Therefore the function attains precisely the positive values.
Hence:
\[ \mathrm{Im}(f)=(0,+\infty). \]
Exercise 13 — level ★★★☆☆
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=|x-2|. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[0,+\infty) \]
Solution
The given function is:
\[ f(x)=|x-2|. \]
The absolute value is defined for every real number. Moreover, the inner expression \(x-2\) is a first-degree polynomial, so it imposes no further restrictions.
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
From the definition:
\[ f:\mathbb{R}\to\mathbb{R}, \]
we deduce that:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
By definition of absolute value, for every \(x\in\mathbb{R}\) we have:
\[ |x-2|\ge0. \]
Therefore the function cannot take negative values.
The minimum value is \(0\), attained when:
\[ x-2=0. \]
Solving:
\[ x=2. \]
Indeed:
\[ f(2)=|2-2|=0. \]
We now show that every positive value is attained.
Let:
\[ y>0. \]
We want to solve:
\[ |x-2|=y. \]
This equation is equivalent to:
\[ x-2=y \qquad \text{or} \qquad x-2=-y. \]
From which:
\[ x=2+y \qquad \text{or} \qquad x=2-y. \]
In either case we obtain a real value belonging to the domain.
Therefore all non-negative values are indeed attained by the function.
Hence:
\[ \mathrm{Im}(f)=[0,+\infty). \]
Exercise 14 — level ★★★★☆
Consider the function:
\[ f:\mathbb{R}\setminus\{2\}\to\mathbb{R} \qquad,\qquad f(x)=\frac{x+1}{x-2}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{2\} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=\mathbb{R}\setminus\{1\} \]
Solution
The given function is:
\[ f(x)=\frac{x+1}{x-2}. \]
Since this is a rational function, the denominator cannot equal zero.
We must therefore require:
\[ x-2\neq0. \]
Hence:
\[ x\neq2. \]
Consequently:
\[ \mathrm{Dom}(f)=\mathbb{R}\setminus\{2\}. \]
From the definition:
\[ f:\mathbb{R}\setminus\{2\}\to\mathbb{R}, \]
we deduce that:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
To determine the range, we set:
\[ y=\frac{x+1}{x-2}. \]
We solve this equation for \(x\), in order to determine for which values of \(y\) there exists at least one preimage \(x\).
Multiplying by \(x-2\):
\[ y(x-2)=x+1. \]
Expanding:
\[ yx-2y=x+1. \]
Collecting terms involving \(x\) on one side:
\[ yx-x=2y+1. \]
Factoring out \(x\):
\[ x(y-1)=2y+1. \]
If:
\[ y\neq1, \]
we can divide by \(y-1\) and obtain:
\[ x=\frac{2y+1}{y-1}. \]
This value is real for every \(y\neq1\).
It remains to check whether the value \(y=1\) can be attained.
Setting:
\[ \frac{x+1}{x-2}=1 \]
and multiplying by \(x-2\), we obtain:
\[ x+1=x-2. \]
Subtracting \(x\) from both sides:
\[ 1=-2, \]
which is a contradiction.
Therefore the value \(1\) is never attained by the function.
Hence:
\[ \mathrm{Im}(f)=\mathbb{R}\setminus\{1\}. \]
Exercise 15 — level ★★★★☆
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=\frac{x^2}{x^2+1}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[0,1) \]
Solution
The given function is:
\[ f(x)=\frac{x^2}{x^2+1}. \]
The denominator is:
\[ x^2+1. \]
Since:
\[ x^2\ge0 \qquad \forall x\in\mathbb{R}, \]
we have:
\[ x^2+1\ge1. \]
Therefore the denominator never vanishes.
Hence:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
From the definition:
\[ f:\mathbb{R}\to\mathbb{R}, \]
we deduce:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
First, we observe that \(x^2\ge0\) and \(x^2+1>0\).
Therefore:
\[ \frac{x^2}{x^2+1}\ge0. \]
Moreover:
\[ x^2 < x^2+1 \qquad \forall x\in\mathbb{R}. \]
Dividing by \(x^2+1>0\), we obtain:
\[ \frac{x^2}{x^2+1}<1. \]
Therefore:
\[ 0\le f(x)<1. \]
The value \(0\) is attained at \(x=0\), since:
\[ f(0)=\frac{0^2}{0^2+1}=0. \]
The value \(1\), on the other hand, is never attained, since this would require:
\[ \frac{x^2}{x^2+1}=1, \]
that is:
\[ x^2=x^2+1, \]
which is impossible.
We now show that every value \(y\) with:
\[ 0\le y<1 \]
is indeed attained.
Solving:
\[ y=\frac{x^2}{x^2+1}. \]
Multiplying:
\[ y(x^2+1)=x^2. \]
Expanding:
\[ yx^2+y=x^2. \]
Collecting terms in \(x^2\) on one side:
\[ x^2-yx^2=y. \]
Factoring out \(x^2\):
\[ x^2(1-y)=y. \]
Since \(y<1\), we can divide by \(1-y>0\):
\[ x^2=\frac{y}{1-y}. \]
For \(0\le y<1\), we have:
\[ \frac{y}{1-y}\ge0. \]
Therefore we may choose:
\[ x=\sqrt{\frac{y}{1-y}}. \]
This value is real and belongs to the domain.
Therefore every \(y\in[0,1)\) is attained by the function.
We conclude that:
\[ \mathrm{Im}(f)=[0,1). \]
Exercise 16 — level ★★★★☆
Consider the function:
\[ f:[0,+\infty)\to[0,+\infty) \qquad,\qquad f(x)=x^2. \]
Find the inverse function.
Answer
The function is invertible, and its inverse is the function \(f^{-1}:[0,+\infty)\to[0,+\infty)\) defined by:
\[ f^{-1}(x)=\sqrt{x}. \]
Solution
The function \(f(x)=x^2\) is considered with domain \([0,+\infty)\) and codomain \([0,+\infty)\). This choice is crucial: on all of \(\mathbb{R}\), the function \(x^2\) would not be injective; restricted to \([0,+\infty)\), however, it becomes both injective and surjective (and therefore bijective) with respect to its codomain.
To find the explicit formula for the inverse function, we set:
\[ y=x^2. \]
Solving for \(x\), we formally obtain two solutions:
\[ x=\pm\sqrt{y}. \]
However, since the domain of the original function is restricted to non-negative real values (\(x\ge0\)), we must discard the negative solution and retain only the positive root:
\[ x=\sqrt{y}. \]
Finally, swapping the roles of the variables \(x\) and \(y\), we obtain the inverse function \(f^{-1}:[0,+\infty)\to[0,+\infty)\) defined by:
\[ f^{-1}(x)=\sqrt{x}. \]
Exercise 17 — level ★★★★☆
Consider the function:
\[ f:[-2,+\infty)\to\mathbb{R} \qquad,\qquad f(x)=\sqrt{x+2}+1. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=[-2,+\infty) \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[1,+\infty) \]
Solution
The given function is:
\[ f(x)=\sqrt{x+2}+1. \]
For the square root to be defined over the real numbers, the radicand must be greater than or equal to zero.
We must therefore require:
\[ x+2\ge0. \]
Solving:
\[ x\ge-2. \]
Therefore:
\[ \mathrm{Dom}(f)=[-2,+\infty). \]
From the definition:
\[ f:[-2,+\infty)\to\mathbb{R}, \]
we deduce that:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
Since \(x+2\ge0\), we have:
\[ \sqrt{x+2}\ge0. \]
Adding \(1\) to both sides:
\[ \sqrt{x+2}+1\ge1. \]
Therefore the function takes only values greater than or equal to \(1\).
The value \(1\) is indeed attained when the square root equals \(0\), that is, when:
\[ x+2=0, \]
giving \(x=-2\).
Indeed:
\[ f(-2)=\sqrt{-2+2}+1=\sqrt{0}+1=1. \]
We now show that every value greater than or equal to \(1\) is attained.
Let:
\[ y\ge1. \]
We solve the equation:
\[ y=\sqrt{x+2}+1. \]
Subtracting \(1\):
\[ y-1=\sqrt{x+2}. \]
Since \(y\ge1\), we have \(y-1\ge0\), so we may square both sides:
\[ (y-1)^2=x+2. \]
From which:
\[ x=(y-1)^2-2. \]
This value belongs to the domain, since:
\[ (y-1)^2-2\ge-2. \]
Therefore every \(y\ge1\) is indeed attained by the function.
We conclude that:
\[ \mathrm{Im}(f)=[1,+\infty). \]
Exercise 18 — level ★★★★☆
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=e^x+2. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=(2,+\infty) \]
Solution
The given function is:
\[ f(x)=e^x+2. \]
The exponential function \(e^x\) is defined for every real number.
Consequently, \(e^x+2\) is also defined for every \(x\in\mathbb{R}\).
Therefore:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
From the definition:
\[ f:\mathbb{R}\to\mathbb{R}, \]
we deduce:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now study the range.
For every \(x\in\mathbb{R}\), the exponential function is strictly positive:
\[ e^x>0. \]
Adding \(2\) to both sides:
\[ e^x+2>2. \]
Therefore the function takes only values strictly greater than \(2\).
The value \(2\) is never attained, since this would require:
\[ e^x+2=2, \]
that is:
\[ e^x=0, \]
which is impossible for any \(x\in\mathbb{R}\).
We now show that every value \(y>2\) is indeed attained.
Let:
\[ y>2. \]
Solving:
\[ y=e^x+2. \]
Subtracting \(2\):
\[ y-2=e^x. \]
Since \(y>2\), we have \(y-2>0\), so we may apply the logarithm:
\[ x=\ln(y-2). \]
This value belongs to \(\mathbb{R}\).
Therefore every \(y>2\) is attained by the function.
We conclude that:
\[ \mathrm{Im}(f)=(2,+\infty). \]
Exercise 19 — level ★★★★★
Consider the function:
\[ f:\mathbb{R}\to\mathbb{R} \qquad,\qquad f(x)=\frac{2x^2+1}{x^2+1}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=\mathbb{R} \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[1,2) \]
Solution
The given function is:
\[ f(x)=\frac{2x^2+1}{x^2+1}. \]
The denominator is \(x^2+1\). Since \(x^2\ge0\) for all \(x\in\mathbb{R}\), we have \(x^2+1\ge1\).
The denominator is therefore always positive and never vanishes.
Hence:
\[ \mathrm{Dom}(f)=\mathbb{R}. \]
From the definition:
\[ f:\mathbb{R}\to\mathbb{R}, \]
we deduce:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
We rewrite the function in a more useful form:
\[ \frac{2x^2+1}{x^2+1} = \frac{2(x^2+1)-1}{x^2+1}. \]
Therefore:
\[ f(x)=2-\frac{1}{x^2+1}. \]
Since \(x^2+1\ge1\), we have:
\[ 0<\frac{1}{x^2+1}\le1. \]
Subtracting this from \(2\), we obtain:
\[ 1\le 2-\frac{1}{x^2+1}<2. \]
Therefore:
\[ 1\le f(x)<2. \]
The value \(1\) is attained at \(x=0\), since:
\[ f(0)=\frac{2\cdot0^2+1}{0^2+1}=1. \]
The value \(2\), on the other hand, is never attained, since:
\[ f(x)=2-\frac{1}{x^2+1} \]
and the term:
\[ \frac{1}{x^2+1} \]
is always strictly positive.
Moreover, as \(|x|\) grows without bound, the quantity \(\frac{1}{x^2+1}\) approaches \(0\), and so \(f(x)\) approaches \(2\) without ever reaching it.
Therefore:
\[ \mathrm{Im}(f)=[1,2). \]
Exercise 20 — level ★★★★★
Consider the function:
\[ f:[1,+\infty)\to\mathbb{R} \qquad,\qquad f(x)=\frac{x-1}{x+1}. \]
Find:
- the domain;
- the codomain;
- the range of the function.
Answer
\[ \mathrm{Dom}(f)=[1,+\infty) \]
\[ \mathrm{Cod}(f)=\mathbb{R} \]
\[ \mathrm{Im}(f)=[0,1) \]
Solution
The given function is:
\[ f(x)=\frac{x-1}{x+1}. \]
The domain is already specified in the definition of the function:
\[ [1,+\infty). \]
We note that on this interval the denominator \(x+1\) never vanishes. Indeed, if \(x\ge1\), then:
\[ x+1\ge2>0. \]
Therefore:
\[ \mathrm{Dom}(f)=[1,+\infty). \]
From the definition:
\[ f:[1,+\infty)\to\mathbb{R}, \]
we deduce:
\[ \mathrm{Cod}(f)=\mathbb{R}. \]
We now determine the range.
For \(x\ge1\), we have \(x-1\ge0\) and \(x+1>0\).
Therefore:
\[ \frac{x-1}{x+1}\ge0. \]
Moreover:
\[ x-1 < x+1 \qquad \forall x\ge1. \]
Dividing by \(x+1>0\), we obtain:
\[ \frac{x-1}{x+1}<1. \]
Therefore:
\[ 0\le f(x)<1. \]
The value \(0\) is attained at \(x=1\), since:
\[ f(1)=\frac{1-1}{1+1}=0. \]
The value \(1\), on the other hand, is never attained. Indeed, \(\frac{x-1}{x+1}=1\) would imply:
\[ x-1=x+1, \]
that is:
\[ -1=1, \]
which is a contradiction.
Finally, we show that every value \(y\) with \(0\le y<1\) is indeed attained.
Solving:
\[ y=\frac{x-1}{x+1}. \]
Multiplying by \(x+1\):
\[ y(x+1)=x-1. \]
Expanding:
\[ yx+y=x-1. \]
Collecting terms in \(x\) on one side:
\[ x-yx=y+1. \]
Factoring out \(x\):
\[ x(1-y)=y+1. \]
Since \(y<1\), we can divide by \(1-y>0\):
\[ x=\frac{y+1}{1-y}. \]
For \(0\le y<1\), we have \(\frac{y+1}{1-y}\ge1\), so the value found belongs to the domain.
Therefore every \(y\in[0,1)\) is indeed attained by the function.
We conclude that:
\[ \mathrm{Im}(f)=[0,1). \]