Example  2

 

 Multimedia

Use the graph of \(y = -2x + 4\) to graph \(y = \left| -2x + 4\right| \).

Begin by graphing \(y = -2x + 4\). It is in slope-intercept form, so the \(y\)-intercept is \(4\) and the slope is \(–2\).



Any \(y\)-values that are zero or positive will remain unchanged. This means the two functions are identical for positive \(y\)-values. Any \(y\)-values that are negative in \(y = -2x + 4\) will become positive in \(y = \left| -2x + 4\right| \). For example, the point \((4, –4)\) becomes \((4, 4)\).

Alternatively, consider the piecewise method of analysis for \(y = \left| -2x + 4\right| \).

When \(x \le 2, -2x + 4 \ge 0\), so \(y = -2x + 4\) for this interval of the domain.

When \(x \gt 2, - 2x + 4 \lt 0\), so \(y = -(-2x + 4)\) or \(y = 2x - 4\) for this interval of the domain.

So, \(y = \left\{\begin{align}
-&2x + 4{\rm\thinspace { for }} \thinspace x \le 2 \\
 &2x - 4{\rm\thinspace { for }} \thinspace x \gt 2 \end{align} \right.\)
.