# Graphing Transformations. Why does the +2 in $f(x) = \sqrt{-x + 2}$ not work as expected when done out of order?

Graphing $f(x) = \sqrt{-x + 2}$ from the graph of $y=\sqrt{x}$.

Correct Method

First graph $f(x) = \sqrt{x}$.

then $f(x) = \sqrt{x+2}$ (shift left 2)

then $f(x) = \sqrt{-x+2}$ (Reflect over Y-axis)

This gives the correct graph.

Incorrect Method

First graph $f(x) = \sqrt{x}$

then $f(x) = \sqrt{-x}$ (Reflect over Y-axis)

then $f(x) = \sqrt{-x+2}$ (this +2 gives the WRONG graph, because it shifts to the left, where to get the correct graph, you'd need to shift to the right)

Can someone explain why $+2$ doesn't behave as expected when the $x$ has already been negated into $-x$ ?

Thanks!

-
If you go from $\sqrt{x}$ to $\sqrt{x+2}$ then you're basically replacing the variable $x$ with $x' = x + 2$. If you start with $\sqrt{-x}$ then replacing $x$ with $x' = x + 2$ gives $\sqrt{-(x+2)} = \sqrt{-x - 2}$. –  TMM Oct 4 '11 at 20:11
Thanks Thijs, 7530, and Steve for helping on this. I guess I needed to think more deliberately about the substitution, and not just "adding" things to the equation. –  JackOfAll Oct 5 '11 at 20:11
Laarhoven's comment is spot-on. If you want to shift a graph left by $a$, you need to replace $x$ by $(x+a)$ everywhere in your equation. In your example $\sqrt{-x}$ becomes $\sqrt{-(x+2)} = \sqrt{-x-2}$, not $\sqrt{-x+2}$.
What you're doing by transforming the graph of sqrt(x) is composing it with other functions. There are three functions at play here: the function $s(x) = \sqrt{x}$, the function $m(x) = -x$ and the function $p(x) = x+2$. By shifting your graph left by two, you go from the graph of $\sqrt{x}$ — that is, $s(x)$ — to the graph of $s(p(x)) = \sqrt{x+2}$. By then applying the flip of $x$, you go from the graph of $s(p(x))$ to the graph of $s(p(m(x)))$ : $\sqrt{(-x)+2}$. When you apply your two transformations in the other order, though, that corresponds to going from $s(x)$ ($\sqrt{x}$) to $s(m(x))$ ($\sqrt{-x}$) to $s(m(p(x)))$ — and that last function is $\sqrt{-(x+2)}$, which is different from $\sqrt{(-x)+2}$.