Skip to main content

Function Transformation

In mathematics, we have systematic ways to alter the basic functions to build new functions out of them. This allows us to have better understanding of how to change functions and how operations on a function impact the look and behavior of the said function.

Vertical and Horizontal Shift

One basic transformation involves shifting the entire graph of a function up, down, left or right. Given a function f(x)f(x)...

  1. The vertical shift shifts f(x)f(x) up or down. Let g(x)=f(x)+kg(x) = f(x) + k where kk is a constant, this new function is a vertical shift of f(x)f(x) by kk units. If kk is positive, the graph will shift up. If kk is negative, the graph will shift down.
  2. The horizontal shift shifts f(x)f(x) left or right. Let g(x)=f(xh)g(x) = f(x - h) where hh is a constant, this new function is a horizontal shift of f(x)f(x) by hh units. If hh is positive, the graph will shift right. If hh is negative, the graph will shift left.

Putting these concepts together, g(x)=f(xh)+kg(x) = f(x - h) + k is a new function that shifts f(x)f(x) vertically by kk units and horizontally by hh units. An example of this is...

Example\underline{Example}

Given f(x)=xf(x) = \:\mid x \mid, describe the shifts to get h(x)=x2+4\:h(x) = \:\mid x - 2 \mid + \:4.

In this instance, k=4k = 4 and h=2h = 2.

We shift f(x)f(x) two units to the right and four units up to get h(x)h(x).

Dashed Graph f(x) and Solid Graph = h(x)
Fig. 1 - Dashed Graph f(x) and Solid Graph = h(x)

Reflection

Another transformation that can be applied to a function is a reflection over the xx or yy axis. Given a function f(x)f(x)...

  1. The vertical reflection reflects f(x)f(x) over the xx-axis. The function g(x)g(x) is a reflection of f(x)f(x) over the xx-axis if g(x)=f(x)g(x) = -f(x).
  2. The horizontal reflection reflects f(x)f(x) over the yy-axis. The function g(x)g(x) is a reflection of f(x)f(x) over the yy-axis if g(x)=f(x)g(x) = f(-x).

For vertical reflection, we multiply all the outputs by 1-1 of the original function. Finally, for the horizontal reflection, we multiply all the inputs by 1-1 of the original function.

Reflection
Fig. 2 - Reflection

Even and Odd Function

Some functions are symmetrical meaning when we reflect the function, we result in the original graph. There are two types of these functions...

  1. An even function is a function whose graph is symmetric about the yy-axis. This means for every xx, f(x)=f(x)f(x) = f(-x). An example of an even function is f(x)=x2f(x) = x^2 because f(x)=(x)2=x2f(-x) = (-x)^2 = x^2.
  2. An odd function is a function whose graph is symmetric about the origin. This means for every xx, f(x)=f(x)f(x) = -f(-x). An example of an odd function is f(x)=x3f(x) = x^3 because f(x)=(x)3=1×1(x3)=x3-f(-x) = -(-x)^3 = -1 \times -1 (x^3) = x^3.

Strech and Compression

Finally, we can transform functions by stretching it or compressing it which changes the shape of the graph. Given a function f(x)f(x)...

  1. Let g(x)=af(x)g(x) = af(x) where aa is a constant. A vertical stretch happens if a>1\mid a \mid\: > 1. On the other hand, a vertical compression happens if 0<a<10 < \:\mid a \mid\: < 1.
  2. Let g(x)=f(bx)g(x) = f(bx) where bb is a constant. A horizontal compression happens if b>1\mid b \mid\: > 1 and in this case the graph will be compressed by 1b\frac{1}{b}. On the other hand, a horizontal stretch happens if 0<a<10 < \:\mid a \mid\: < 1 and in this case the graph will be stretched by 1b\frac{1}{b}.
Stretch and Compression
Fig. 3 - Stretch and Compression
note

The sign of the constants aa and bb does not transform the stretch or compression but instead transforms the reflection of the graphs.

With all our transformations put together, we get the equation...

g(x)=±a×f(±b(xh))+kg(x) = \pm a \times f(\pm b(x - h)) + k

where ±a\pm a transforms by vertical stretch or compression and vertical reflection, ±b\pm b transforms by horizontal stretch or compression and horizontal reflection, hh transforms by horizontal shift, and kk transforms by vertical shift.