In the previous section, we got familiar with the graphs of many important functions. We may use these graphs and simply shift, reflect, or stretch them to sketch the graphs of many more functions. In this section, we will learn how to do that. As we discussed before graphs of functions provide much valuable information about the functions.

In this section, suppose the graph of $y=f(x)$ is known.

Table of Contents

## Graph of *y* = *f*(*x*) ± *c*: Vertical Shift

Consider some function $f$. If the point $(1,3)$ is on the graph of $f$, it means $f(1)=3$. If the function $g$ is defined such that

\[

g(x)=f(x)+2

\]
then we immediately conclude that the point $(1,5)$ is on the graph of $g$ because $g(1)=f(1)+2=3+2=5.$

\[

(1,3)\text{ on the graph of }f\quad\stackrel{g(x)=f(x)+2}{\Longleftrightarrow}(1,5)\text{ on the graph of }g

\]
In general, if $(a,b)$ is on the graph of $f$ (meaning $f(a)=b)$,then we know that the point $(a,b+2)$ is on the graph of $g$ because $g(a)=f(a)+2=b+2.$

\[

(a,b)\text{ on the graph of }f\quad\stackrel{g(x)=f(x)+2}{\Longleftrightarrow}(a,b+2)\text{ on the graph of }g

\]
So the graph of $g$ is the graph of $f$ shifted upward 2 units.

## Graph of *y* = *f*(*x *∓ *c*): Horizontal Shift

Consider some function $f$. If the point $(1.5,4)$ is on the graph of $f$, it means $f(1.5)=4$. If the function $g$ is defined such that

\[

g(x)=f(x-2)

\]
then we know that the point $(3.5,4)$ is on the graph of $g$ because $g(3.5)=f(3.5-2)=f(1.5)=4$.

\[

(1.5,4)\text{ on the graph of }f\quad\stackrel{g(x)=f(x-2)}{\Longleftrightarrow}(3.5,4)\text{ on the graph of }g

\]
In general, if the point $(a,b)$ is on the graph of $f$, then the point $(a+2,b)$ is on the graph of $g$:

\[

(a,b)\text{ on the graph of }f\quad\stackrel{g(x)=f(x-2)}{\Longleftrightarrow}(a+2,b)\text{ on the graph of }g

\]
So the graph of $g$ is the graph of $f$ shifted 2 units to the right.

More generally if $g(x)=f(x-c)$ then

\[

\boxed{(a,b)\text{ on the graph of }f\quad\stackrel{g(x)=f(x-c)}{\Longleftrightarrow}(a+c,b)\text{ on the graph of }g}

\]

Graphically this means that:

Note that when we **subtract** a constant $c>0$ from the input of a function, the graph shifts to the **right **(not to the left), and when we add $c>0$ to the input of a function, its graph shifts to the left! In other words, shifts in the argument (= input) of a function are horizontal shifts to its graph opposite the sign. This is illustrated in Figure 2.

## Graph of *y* = – *f*(*x*): Reflection in the *x*-axis

Consider some function $f$. Suppose the points $(1,2)$ and $(3,-4)$ are on the graph of $f$ meaning$f(1)=2$ and $f(3)=-4$. If the function $g$ is defined such that $g(x)=-f(x)$, we then conclude that $(1,-2)$ and $(3,4)$ are on the graph of $g$ because $g(1)=-f(1)=-2$ and $g(3)=-f(3)=-(-4)=4$.

\[

(1,2),(3,-4)\text{ on the graph of }f\quad\stackrel{g(x)=-f(x)}{\Longleftrightarrow}\quad(1,-2),(3,4)\text{ on the graph of }g.

\]
or generally

\[

\boxed{(a,b)\text{ on the graph of }f\quad\stackrel{g(x)=-f(x)}{\Longleftrightarrow}\quad(a,-b)\text{ on the graph of }g.}

\]
Graphically it means:

## Graph of *y* = *f*(-*x*): Reflection in the y-axis.

Consider some function $f$. If the points $(1.5,3.7)$ and $(-2.3,-5)$ are on the graph of $f$, it means $f(1.5)=3.7$ and $f(-2.3)=-5$.If the function $g$ is defined such that $g(x)=f(-x)$, we conclude that $(-1.5,3.7)$ and $(2.3,-5)$ are on the graph of $g$ because $g(-1.5)=f(1.5)=3.7$ and $g(2.3)=f(-2.3)=-5$.

\[

(1.5,3.7),(-2.3,-5)\text{ on the graph of }f\quad\stackrel{g(x)=f(-x)}{\Longleftrightarrow}\quad(-1.5,3.7),(2.3,-5)\text{ on the graph of }g.

\]

In general, if $g(x)=f(-x)$

\[

\boxed{(a,b)\text{ on the graph of }f\quad\stackrel{g(x)=f(-x)}{\Longleftrightarrow}\quad(-a,b)\text{ on the graph of }g.}

\]
Graphically this means:

## Graph of *y *= c *f*(*x*): Vertical Scaling

Suppose the function $g$ is defined such that

\[

g(x)=cf(x).

\]
Then

\[

(a,b)\text{ on the graph of }f\Longleftrightarrow(a,cb)\text{ on the graph of }g

\]
because

\[

g(a)=cf(a)=cb.

\]

So we can obtain the graph of $y=cf(x)$ by replacing every point $P(x,y)$ that is on the graph of $f$ by the point $P'(x,cy)$.That is, the $y$-coordinate of each point on the graph of $f$ has been enlarged $c$ times if $c>1$ or reduced $1/c$ times if $0<c<1$.

To obtain the graph $y=cf(x)$ from the graph of $y=f(x)$

- If $c>1$,
**vertically**stretch the graph of $f$ (away from the $x$-axis) by a factor of $c$ (Figure 12(a)). - If $0<c<1$,
**vertically**compress the graph of $f$ (toward the $x$-axis) by a factor of $c$ (Figure 12(b)). - If $c<0$, first by vertically stretching or compressing to obtain the graph of $y=|c|f(x)$ and then reflect the result in the $x$-axis.

Obviously $c=1$ has no effect.

(a) $c>1$ | (b) $0<c<1$ |

**Figure 12:** The graph of $y=cf(x)$ is obtained by stretching the graph of $y=f(x)$ vertically if $ c>1$ and by compressing it vertically if $0<c<1$.

## Graph of *y *= *f *(*cx*): Horizontal Scaling

Suppose the function $g$ is defined such that

\[

g(x)=f(cx).

\]
Then

\[

(a,b)\text{ on the graph of }f\Longleftrightarrow(a/c,b)\text{ on the graph of }g

\]
because

\[

g\left(\frac{a}{c}\right)=f\left(c\frac{a}{c}\right)=f(a)=b.

\]
In other words, we can obtain the graph of $ y=f(cx)$ by replacing every point $P(x,y)$ that is on the graph of $f$ by the point $P'(x/c,y)$. That is, the $x$-coordinate of each point on the graph of $f$ has been reduced $1/c$ times if $c>1$ or enlarged $1/c$ times if $0<c<1$.

Graphically this means:

- If $c>1$,
**horizontally**compress the graph of $f$ (toward the $x$-axis) by a factor of $1/c$ (Figure 14(a)). - If $0<c<1$,
**horizontally**stretch the graph of $f$ (away from the $x$-axis) by a factor of $1/c$ (Figure 14(b)). - If $c<0$, first horizontally compress or stretch by a factor of $|1/c|$and reflect the result in the $y$-axis.

(a) $c>1$ | (b) $0<c<1$ |

**Figure 14:** The graph of $y=f(cx)$ is obtained by horizontally compressing the graph of $ y=f(x)$ toward the $y$-axis if $ c>1$ and by stretching it if $0<c<1$.

## Combining Transformations

Now we consider the general case:

Suppose we have the graph of $y=f(x)$ and we wish to obtain the graph of

\[

y=kf(ax-b)+h,\tag{i}

\]
It is important to apply these transformations to the graph of $y=f(x)$ in the following order:

1. Horizontal scaling by a factor of $1/|a|$ (If $a<0$, it will be followed by a reflection in the $y$-axis)

2.Horizontal shift by $b/a$ units

3. Vertical scaling by a factor of $|k|$ (followed by a reflection in the $x$-axis if $k<0$)

4. Vertical shift by $h$ units

**Why such a sequence of transformations?**

We first rewrite it as

\[

y=kf\big(a(x-b/a)\big)+h

\]
Consider the function $g$ defined as

\[

g(x)=f(ax).

\]
The graph of $g$ is obtained by horizontally scaling by a factor of $1/|a|$ (followed by a reflection in the $y$ axis if $a<0$).

Now consider the function $F$ defined as

\[

F(x)=g(x-b/a)=f(a(x-b/a)).

\]
So the graph of $y=F(x)$ is the graph of $g$ horizontally shifted by $b/a$ units. Finally consider the function $G$ defined as

\begin{align*}

G(x) & =kF(x)+h\\

& =kf(a(x-b/a))+h.

\end{align*}

The graph of $G$ is what we are looking for and is obtained by a vertical scaling by a factor of $|k|$ (followed by a reflection in the $x$-axis if $k<0$) and then a vertical shift by $h$ units.

## Graph of *y* = |*f*(*x*)|: Reflection of the Negative Part

Taking the absolute value of $f(x)$ changes all negative outputs of $f$ into their opposites and leaves nonnegative outputs unchanged.

Graphically, this means:

## Graph of *y *= *f*(|*x*|): Duplication and Reflection of the Right Part

Suppose the function $g$ is defined such that

\[

g(x)=f(|x|).

\]
If, for example, $(1,-3)$ is on the graph of $f$, then $(1,-3)$ and $(-1,-3)$ are on the graph of $g$ because $g(1)=f(|1|)=f(1)=-3\text{ and }g(-1)=f(|-1|)=f(1)=-3$.

In general, if $(a,b)$ is on the graph of $f$ and $a\ge0$ then $g(a)=f(|a|)=f(a)=b$. Also $g(-a)=f(|-a|)=f(|a|)=f(a)=b$ Therefore:

\[

\boxed{(a,b)\text{ on the graph of }f\text{ and }a\ge0\Rightarrow(a,b)\text{ and }(-a,b)\text{ on the graph of }g}

\]
Graphically it means:

- Note that if $g(x)=f(|x|)$, then $g$ is an even function because for all $x$ in the domain of $g$ we have

\begin{align*}

g(-x) & =f(|-x|)

& =f(|x|)

& =g(x).

\end{align*}

So the graph of $g$ has to be symmetric about the $y$-axis.

- Graphs of two functions $f$ and $g$ are shown in Figure 22(a,b). Because the parts of these two graphs that are left of the$y$-axis coincide, the graphs of $y=f(|x|)$ and $y=g(|x|)$ are the same (Figure 22(c)).