If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Algebra 2>Unit 9

Lesson 1: Shifting functions

# Shifting functions examples

Sal analyzes two cases where functions f and g are given graphically, and g is a result of shifting f. He writes formulas for g in terms of f and in terms of x.

## Want to join the conversation?

• at , why did Sal do x minus the horizontal shift and x plus the vertical shift? is there some kind of rule that explains why the horizontal shift must be subtracted and the vertical shift must be added?
• there isn't a rule that you follow for subtracting and adding the horizontal shift and vertical shift, it just depends on what directions you went on the graph.
• Can someone please explain a little further what the second question is asking?

what is the connection between g(x)= f(x+2)+5 and f(x) = sqrt(x+4)-2 ?
• so you're trying to write an expression in terms of x for g(x)* right?

You have the expression for *f(x)* which is *f(x)+sqrt(x+4)-2
and you have the expression for g(x)* after solving, which is *g(x)=f(x+2)+5.

But now, you have f(x)* in your equation for *g(x)*. In order to get rid of that and have an equation for *g(x)* you need to solve both the equations.

Now you put them all together like he did at by substituting for *f(x)=sqrt(x+4)-2
with the expression for g(x)= f(x+2)+5.

~ f(x+2)=sqrt(x+2+4)-2

~f(x+2)=sqrt(x+6)-2

~f(x+2+5)=sqrt(x+6)-2+5

~f(x+2+5)=sqrt(x+6)+3

~and since f(x+2+5)=g(x)*

--> *g(x)=sqrt(x+6)+3

I hope I cleared something up instead of messing you up more.
• I can not visualise this 'negative' for vertical and 'positive' for horizontal. Can someone explain? Why we are shifting like this?
• Could you be a little more specific with "negative for vertical" and "positive for horizontal"? I don't quite understand what you are asking. Or maybe you could give me a timestamp from the video you are watching, so I can help you?
• Sal... Tell me if I am wrong... but the way I think about it is this is somewhat like completing the square. When you complete the square and find a value for C. Like Sal says you can't just willy-nilly add "C" without either adding that same amount to the other side or subtracting from the same side. In this case you are "extracting" a given value from X. This forces "X" to make up for it. For Example: If I have to have a pile of marbles that are equal to "X" amount, but I know I will have someone come along and take two marbles before I even start counting them, then I need to have X be equal to two more marbles. Substitute X for a number. I can either have X be equal to 10 or 12-2. Again... subtracting 2, forces my starting X value to be worth 2 more. Am I on the right track?
• well this is what i think , if you substitute the value x with 2 then you will be subtracting the two marbles that you did not even count on together with the other ones.
• I know that f(x)= √(x+4) -2.
If we put x=√(x-4) -2 into f(x+2),
I think it should be √(x+4) +2 instead of √(x+2+4)
I'm really confused. Really appreciated someone can help me!
• f(x)= √(x+4) -2 and you are trying to find f(x+2)
The "x+2" is your input value. You replace the "x" in the function with "x+2"
The "x" is inside the square root. So, that "x" changes to "x+2"
f(x+2)= √(x+2+4) -2

What you calculated is f(x)+2. The 2 in your scenario is not an input. You just added 2 to the entire function.
Hope this helps you see the difference.
• At , why does Sal shift the blue line ( I honestly don't know what we call it ). Can't we shift the pink one?
• We can just call the blue line f(x) cause it's the name, likewise the pink line g(x).

The question that's raised is "what is g(x) in terms of f(x)?" That means, we have to shift f(x) until it matches g(x).
If the question asks "what if f(x) in terms of g(x)?" then we will have to shift g(x) until it matches f(x).

Everything is dependent on what the question asks for, so watch out for that. Hopefully that helps !
• Hi, it is first time I do math online . I can't figure out the format for typing my answers.
I am going back to school in the fall and my class is given only online. I am not very good with computers, and I am really freaking out. Is there tutorials for this?
• I have to say Sal is usually very clear in all his videos but this one has been really brushed off quickly! The steps are quick and not easy to follow. I thought about it today (all day), I came up with a system/way to digest this. At the end, if we consider where Sal started from and where he arrived it all makes a little more sense:
f(x)= √(x+4) -2
g(x)=√(x+6) +3
----------------
g(x)=f(x+2)+5

I note here from +4 to get to +6 I need +2 and from -2 to get to +3 I need a +5. Now the problem is how did he actually do it? The steps in the middle are chaotic and really not clear...