Sub topic 4
Moving a Graph Left and Right
Assume you know function notation, can evaluate \(f(x)\), and understand the graphs and domains of basic functions such as \(x^2\), \(|x|\), and \(\sqrt{x}\). This chapter focuses on horizontal shifts, which change the input of a function.
The horizontal-shift rule
For a function \(y=f(x)\), the expression
\[ g(x)=f(x-h) \]
moves the graph horizontally by \(h\) units.
- If \(h>0\), the graph moves \(h\) units right.
- If \(h<0\), the graph moves \(|h|\) units left.
The sign can seem backward because the change occurs inside the function. To make a familiar input \(x_0\) reach \(f\), solve
\[ x-h=x_0. \]
This gives \(x=x0+h\). Therefore, every point \((x0,y_0)\) on \(f\) moves to
\[ (x0+h,y0) \]
on \(g\).
| Function | Horizontal movement |
|---|---|
| \(f(x-4)\) | 4 units right |
| \(f(x+4)=f(x-(-4))\) | 4 units left |
| \(f(x)\) | No horizontal movement |
Reading the shift from a graph
Start with the parent graph, the basic graph before transformations. For example, the parent function
\[ f(x)=x^2 \]
has vertex \((0,0)\). Replacing \(x\) with \(x-3\) gives
\[ g(x)=(x-3)^2. \]
The vertex moves from \((0,0)\) to \((3,0)\), so the parabola moves 3 units right.
Replacing \(x\) with \(x+2\) gives
\[ h(x)=(x+2)^2=(x-(-2))^2. \]
The vertex moves to \((-2,0)\), so the graph moves 2 units left.
The same rule works for other parent functions. For \(f(x)=|x|\), the vertex moves with the horizontal shift. For \(f(x)=\sqrt{x}\), the endpoint moves, and the domain changes with it.
Domain and key points
A horizontal shift changes the domain because all \(x\)-coordinates move. It does not directly change the range.
For
\[ f(x)=\sqrt{x}, \]
the domain is \(x\ge 0\), and the range is \(y\ge 0\). Consider
\[ g(x)=\sqrt{x-5}. \]
The radicand must be nonnegative:
\[ x-5\ge 0 \quad\Rightarrow\quad x\ge 5. \]
Thus, the endpoint moves from \((0,0)\) to \((5,0)\). The domain is \([5,\infty)\), while the range remains \([0,\infty)\).
For any point \((x,y)\) on \(f\), the shifted graph \(g(x)=f(x-h)\) uses
\[ (x,y)\longrightarrow(x+h,y). \]
This point rule is often safer than trying to remember the sign visually.
Using a horizontal scale factor
A more general expression is
\[ g(x)=f(b(x-h)). \]
The \(h\) still controls the horizontal shift, but \(b\) also changes horizontal scale. If \(b\ne 1\), evaluate the inside expression carefully. The parent input is \(u=b(x-h)\). To map a parent point \((u,y)\), solve
\[ u=b(x-h), \]
so
\[ x=\frac{u}{b}+h. \]
Therefore,
\[ (u,y)\longrightarrow\left(\frac{u}{b}+h,y\right). \]
When \(b\) is negative, the horizontal mapping also reflects the graph across the \(y\)-axis.
def shifted(f, h):
"""Return g(x) = f(x - h), a horizontal shift by h."""
return lambda x: f(x - h)
f = lambda x: x ** 2
g = shifted(f, 3)
print(g(3)) # 0, the shifted vertex
print(g(4)) # 1
print(g(2)) # 1Exercise
The graph of f has the point (−2, 5). Where does this point move on g(x) = f(x + 4)?
Show answer
Rewrite x + 4 as x − (−4), so h = −4. The point moves to (−6, 5).