# Find the range the of a function with given domain. Give your answer using interval notation.

Question: Find the range of the function $$f(x)=x^2-1,\quad x\in(-2,1),$$ where the interval $(-2,1)$ is defined on $\mathbb{R}$.

My work:

$f(-2)=(-2)^2-1=3$

$f(1)=1-1=0$

So $f(x)$ has a range = $(3,0)$

I know this is a simple question, but I would really appreciate a correct answer with a clear explanation.

• To find the range of the function, it is not enough to check the endpoints of the interval that is your domain. This is only true when the function is non-increasing, or non-decreasing, over your domain. For example, the range of $\sin(x)$ over $(0,\pi)$ is not the single point $\sin(0) = 0 = \sin(\pi)$. I suggest taking a look at a graph if you can. – dannum Jan 18 '15 at 19:01

Here is an answer that uses calculus.

Note that $f^\prime(x)=2\,x$ and $f^{\prime\prime}(x)=2$. This tells us that $f(x)$ has a global minimum of $f(0)=-1$ on the interval $(-2,1)$. Furthermore, $f(-2)=3$ and $f(1)=0$ so the image of $f(x)$ on $(-2,1)$ is $[-1,3)$.

• Thank you so much. But if $f(1)=0$, how would the interval start at $-1$ ? – Mohamed Jan 18 '15 at 19:02
• $[-1,3)=\{x\in\Bbb R:-1\leq x<3\}$ so $0\in[-1,3)$ – Brian Fitzpatrick Jan 18 '15 at 19:05
• @BrianFitzpatrick I think your answer, while quite correct, is a little bit over the OP's head. – Daniel W. Farlow Jan 18 '15 at 19:06

At $x=0 ,f(x)=-1$ this suggests your range is incorrect. It is necessary to consider other points than the boundaries of the domain. Here I tried the $x$ coordinate at the turning point of the graph. In this case think of the graph $y=x^2$ that has been translated or shifted one down.

Here is an answer that is more intuitive perhaps but does not require knowledge of calculus.

Consider the nature of your function $f(x)=x^2-1$. You want the range of this function. What is the largest value this function could obtain?

Since $x^2$ will always be positive, we should input the largest number (in terms of "size" or "magnitude") from the domain, namely $x=-2$ (but remember $x\in(-2,1)$; thus, we are not actually using exactly $x=-2$ but a number very close to this). This will yield the maximum value of $x^2$. Thus, $f(-2)=(-2)^2-1=3$ may be thought of as the end point of the range or the largest value obtained for $f(x)$.

As before, $x^2$ will always be positive. Thus, to find the other end point of the range, the minimum value obtained by $f(x)$ will be the input value that minimizes $x^2$, namely $x=0$. Thus, $f(0)=(0)^2-1=-1$. Notice that $x=0$, unlike $x=-2$, is actually in the domain $(-2,1)$. Thus, the range will be $[-1,3)$.

Does that make more sense? It's a pretty "dirty" explanation, but it may be clearer than thinking about it in calculus terms.

• It does make more sense :) I actually learned from the comments more than I did in class. Thank you, appreciate your efforts :D – Mohamed Jan 18 '15 at 19:27

Consider the graph of the function $f(x) = x^2 - 1, -2 < x < 1$.

The graph is obtained by shifting the graph of $y = x^2$ down one unit and restricting the domain so that $-2 < x < 1$. I have drawn open circles at the endpoints since they are not included.

We can see from the graph that $-1 \leq f(x) < 3$. Hence, the range of the function is $R_f = [-1, 3)$.

Where you made your mistake was in assuming that $f(-2) \geq f(x) \geq f(1)$ for each $x$ in the interval $(-2, 1)$. However, we know that $x^2 \geq 0$ for each real number $x$, with equality holding if and only if $x = 0$. Thus, $x^2 - 1 \geq -1$, with equality holding if and only if $x = 0$. Since $-2 < 0 < 1$, the function $f(x) = x^2 - 1, -2 < x < 1$ reaches its minimum at $x = 0$. Since $f(x)$ decreases on the interval $(-2, 0]$ and increases on the interval $[0, 1)$, its upper bound must occur at one of the endpoints. Since $(-2)^2 - 1 = 3 > 0 = 1^2 - 1$, the function has an upper bound of $3$.

Hint: You need to check that function does not have a maxima or minima within the given interval. If it does, than maxima or minima is your answer.
Else, one of the endpoints will be the answer as the function will constantly increase or decrease.
In $f(x)=x^{2}-1$, $f(x)$ has a minimum value at $x=-1$. This implies that $f(-1)$ will be the minima whereas the maxima will be one of the endpoints of the interval as the function has no global maxima. (Hint: look at it's graph)
Edit: If the function does not have a maxima or minima, it would be either constantly decreasing or constantly increasing within the interval. For example, if $f(x)=x-2$, the function would be constantly increasing as it's derivitive is a positive constant term $1$, and hence the endpoints of the interval will be the respective maxima or minima wthin that interval.

• Thank you sir. If it does not have a maxima or minima, for example $f(x)=2x+7$ $x∈[0,1]$ then I just keep the values of x to get the image of $f(x)$, right? – Mohamed Jan 18 '15 at 19:20
• @Mr.Mohamed, That is correct, as you can see, we get a constant term $2$ on differentiating the function. This means that we can put the values of $x$ at the endpoints to get the values of maxima and minima – AvZ Jan 18 '15 at 19:27