We can also stretch and shrink the graph of a function. To stretch or
shrink the graph in the y direction, multiply or divide the output by a
constant. 2f (x) is stretched in the y direction by a factor of 2, and
f (x) is shrunk in the y direction by a factor of 2 (or stretched
by a factor of ). Here are the graphs of y = f (x), y = 2f (x),
and y = x. Note that if (x, y_{1}) is a point on the graph of
f (x), (x, y_{2}) is a point on the graph of 2f (x), and (x, y_{3}) is a point
on the graph of f (x), then y_{2} = 2y_{1} and y_{3} = y_{1}.
For example, (3, 2) is on the graph of f (x), (3, 4) is on the graph of
2f (x), and (3, 1) is on the graph of f (x).

To stretch or shrink the graph in the x direction, divide or multiply the
input by a constant. As in translating, when we change the input, the function changes
to compensate. Thus, dividing the input by a constant stretches the function in
the x direction, and multiplying the input by a constant shrinks the function
in the x direction. f (x) is stretched in the x direction by a
factor of 2, and f (2x) is shrunk in the x direction by a factor of 2 (or
stretched by a factor of frac12). Here is a graph of y = f (x), y = f (x), and y = f (2x). Note that if (x_{1}, y) is a point on the
graph of f (x), (x_{2}, y) is a point on the graph of f (x), and
(x_{3}, y) is a point on the graph of f (2x), then x_{2} = 2x_{1} and x_{3} = x_{1}. For example, (- 2, 5) is on the graph of f (x), (- 4, 5) is
on the graph of f (x), and (- 1, 5) is on the graph of f (2x).

We can understand the difference between altering inputs and altering outputs by
observing the following:

If g(x) = 3f (x): For any given input, the output iof g is three times the
output of f, so the graph is stretched vertically by a factor of 3.

If g(x) = f (3x): For any given output, the input of g is one-third the input
of f, so the graph is shrunk horizontally by a factor of 3.