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.

# Finding inverse functions: linear

Sal finds the inverses of f(x)=-x+4 and g(x)=-2x-1. Created by Sal Khan.

## Want to join the conversation?

• really helpful this video but i would like to ask whether inverse functions are involved with or have anything to do with reciprocals?
• There is a relationship between reciprocal and inverse functions only when talking about multiplying or dividing. For example, if your original function is f(x)=(3/7)x, then the inverse function is (7/3)x. This does not work in general for all functions, though.
• Thanks Sal, great video. One question... do inverse functions have anything to do with reciprocals?
• Yes, (somewhat) the inverse function will always have a SLOPE that is the RECIPROCAL of the original function. The y intercept, however, will be the opposite of the original y intercept divided by the original slope. (Nothing to do with reciprocal).
• Why do we need to know the inverse of a function ?
• Inverses are all over, the inverse of + is - and the inverse of multiplication is division, and there are plenty of others! I can think of a few reasons for wanting to know. The first is kind of a reverse engineering thing. If you can find the inverse of a function then you can "undo" what the function did. For example, if you now the formula to convert degrees Celsius into degrees Fahrenheit, the inverse will convert Fahrenheit to Celsius. If a function does not have an inverse, it tells us something about the the function and it's shape. When we know if a function has an inverse or not, we can know that the function has certain properties and we can use those properties to understand more about the behavior of the function and its applications. You'll find out more about this if you move on to calculus or real analysis or number theory. So, like a lot about mathematics, you may not understand the "why" at the moment, but in time you will as your mathematical maturity grows.
Great Question! Have Fun!
• Hey, great video, i was just wondering if someone could help me understand what f'(x) meant, i was under the impression it was the inverse, but i know now that the inverse is f^-1(x)
• f' is the "derivative" of f. You will encounter derivatives in a calculus course.
• If the slope was -1/2 why didn't he go over 1 and down 2?
• I was confused by this also. Why didn't he go down one and right two? Instead he only went down 1/2.
• Can you just switch the x's and y's before you solve in terms of y, that way you keep solving in terms of x, and you already find the f^-1(x)
• Yes you can. That's actually how I've always done it myself. In the case of y = -x + 4 that's the only step you need in order to get the inverse. However, it still works the same way for y = x^2 + 4.

In that case you can find the inverse of the function y = x^2 + 4 with the following steps:
x = y^2 + 4
x - 4 = y^2
x = ±sqr(y - 4) sqr = square root sign.

And it works for Sal's second example.
y = -2x -1
x = -2y -1 (switch variables)
x + 1 = -2y
-x -1 = 2y
y = -x/2 -1/2
• In the second function, why doesn't "-x/2 - 1/2" become "-x - 1"? (Because both expressions have the same denominator.)
Thanks!
• If we did that, we'd have to multiply =X by two which would defeat the whole purpose of simplifying the expression. But we could, it would just be -x-1=2x and we wouldn't have the inverse function.
• whats the difference between inverse function and reciprocal functions ?
• I think giving an example is the easiest way to explain this.
Given a function f(x)=5x+3
Find its reciprocal and its inverse.
answer 1: `reciprocal of f(x)=1/f(x) = 1/(5x+3)`
answer 2: `inverse of f(x)=(x-3)/5`
solution for number 2:
`1st step` solve for f(x)
f(x)=5x+3 original function
f(x)-3=5x+3-3 subtracting fro both sides
f(x)-3=5x we get this then
(f(x)-3)/5=x dividing both sides by 5
`2nd step` swap the sides and let f(x)=x and x=inverse of f(x) or just f(x)
inverse of f(x)=(x-3)/5
• Why do you swap the y for the x? I would rather understand why than memorize.
• Because usually functions are written as a function of "x", where "y" is the dependent variable.(You plug a value of "x" into the function and get a value of "y"). You could just solve for x and leave it as a function of the form f(y), but it would look weird. It's just convention.
• When it comes to solving the inverse function, one of the examples for f^-1(x). I thought the variable was supposed to be y, when it comes to solving for inverse functions. Why do I need to put x for answer?
• We are just renaming it to something we are more familiar with. No changes were made to the inverse function, just a different name/variable.
When you graph f^-1(y), the input y will be on the x-axis, not the y-axis. So this might conflict with our brain processing. Our brain might be thinking of the y axis instead. So it's easier to rename it.

## Video transcript

So we have f of x is equal to negative x plus 4, and f of x is graphed right here on our coordinate plane. Let's try to figure out what the inverse of f is. And to figure out the inverse, what I like to do is I set y, I set the variable y, equal to f of x, or we could write that y is equal to negative x plus 4. Right now, we've solved for y in terms of x. To solve for the inverse, we do the opposite. We solve for x in terms of y. So let's subtract 4 from both sides. You get y minus 4 is equal to negative x. And then to solve for x, we can multiply both sides of this equation times negative 1. And so you get negative y plus 4 is equal to x. Or just because we're always used to writing the dependent variable on the left-hand side, we could rewrite this as x is equal to negative y plus 4. Or another way to write it is we could say that f inverse of y is equal to negative y plus 4. So this is the inverse function right here, and we've written it as a function of y, but we can just rename the y as x so it's a function of x. So let's do that. So if we just rename this y as x, we get f inverse of x is equal to the negative x plus 4. These two functions are identical. Here, we just used y as the independent variable, or as the input variable. Here we just use x, but they are identical functions. Now, just out of interest, let's graph the inverse function and see how it might relate to this one right over here. So if you look at it, it actually looks fairly identical. It's a negative x plus 4. It's the exact same function. So let's see, if we have-- the y-intercept is 4, it's going to be the exact same thing. The function is its own inverse. So if we were to graph it, we would put it right on top of this. And so, there's a couple of ways to think about it. In the first inverse function video, I talked about how a function and their inverse-- they are the reflection over the line y equals x. So where's the line y equals x here? Well, line y equals x looks like this. And negative x plus 4 is actually perpendicular to y is equal to x, so when you reflect it, you're just kind of flipping it over, but it's going to be the same line. It is its own reflection. Now, let's make sure that that actually makes sense. When we're dealing with the standard function right there, if you input a 2, it gets mapped to a 2. If you input a 4, it gets mapped to 0. What happens if you go the other way? If you input a 2, well, 2 gets mapped to 2 either way, so that makes sense. For the regular function, 4 gets mapped to 0. For the inverse function, 0 gets mapped to 4. So it actually makes complete sense. Let's think about it another way. For the regular function-- let me write it explicitly down. This might be obvious to you, but just in case it's not, it might be helpful. Let's pick f of 5. f of 5 is equal to negative 1. Or we could say, the function f maps us from 5 to negative 1. Now, what does f inverse do? What's f inverse of negative 1? f inverse of negative 1 is 5. Or we could say that f maps us from negative 1 to 5. So once again, if you think about kind of the sets, they're our domains and our ranges. So let's say that this is the domain of f, this is the range of f. f will take us from to negative 1. That's what the function f does. And we see that f inverse takes us back from negative 1 to 5. f inverse takes us back from negative 1 to 5, just like it's supposed to do. Let's do one more of these. So here I have g of x is equal to negative 2x minus 1. So just like the last problem, I like to set y equal to this. So we say y is equal to g of x, which is equal to negative 2x minus 1. Now we just solve for x. y plus 1 is equal to negative 2x. Just added 1 to both sides. Now we can divide both sides of this equation by negative 2, and so you get negative y over 2 minus 1/2 is equal to x, or we could write x is equal to negative y over 2 minus 1/2, or we could write f inverse as a function of y is equal to negative y over 2 minus 1/2, or we can just rename y as x. And we could say that f inverse of-- oh, let me careful here. That shouldn't be an f. The original function was g , so let me be clear. That is g inverse of y is equal to negative y over 2 minus 1/2 because we started with a g of x, not an f of x. Make sure we get our notation right. Or we could just rename the y and say g inverse of x is equal to negative x over 2 minus 1/2. Now, let's graph it. Its y-intercept is negative 1/2. It's right over there. And it has a slope of negative 1/2. Let's see, if we start at negative 1/2, if we move over to 1 in the positive direction, it will go down half. If we move over 1 again, it will go down half again. If we move back-- so it'll go like that. So the line, I'll try my best to draw it, will look something like that. It'll just keep going, so it'll look something like that, and it'll keep going in both directions. And now let's see if this really is a reflection over y equals x. y equals x looks like that, and you can see they are a reflection. If you reflect this guy, if you reflect this blue line, it becomes this orange line. But the general idea, you literally just-- a function is originally expressed, is solved for y in terms of x. You just do some algebra. Solve for x in terms of y, and that's essentially your inverse function as a function of y, but then you can rename it as a function of x.