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.

Main content

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?

  • blobby green style avatar for user Haris Ali
    really helpful this video but i would like to ask whether inverse functions are involved with or have anything to do with reciprocals?
    (24 votes)
    Default Khan Academy avatar avatar for user
    • leafers ultimate style avatar for user GFauxPas
      Not any relationship between reciprocal and inverse that I can think of. Unfortunately the notation for inverse is f⁻¹ which LOOKS like you're raising something to the -1st power which is taking the reciprocal. It's a coincidence: the symbols look the same but have nothing to do with each other.
      (52 votes)
  • mr pants teal style avatar for user Mohamed Kayali
    Thanks Sal, great video. One question... do inverse functions have anything to do with reciprocals?
    (20 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Andrew Dvorak
    If the slope was -1/2 why didn't he go over 1 and down 2?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user 14jwilliams
      Hi Andrew. Slope is rise/run, where rise is the amount of change in y-value (up or down), and run is the value of increase along the x-value (moving right). So -1/2 slope means down 1, right 2. I hope this helps you, but I'm tired and not sure this is written clearly.
      (27 votes)
  • piceratops ultimate style avatar for user mathisawesome2169
    Why do we need to know the inverse of a function ?
    (8 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Stefen
      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!
      (24 votes)
  • piceratops tree style avatar for user Jareth MacArthur
    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)
    (15 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user stat.rob.dozier
    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)
    (7 votes)
    Default Khan Academy avatar avatar for user
    • leafers ultimate style avatar for user Boris Stanchev
      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
      (11 votes)
  • leaf red style avatar for user Hope Gold
    In the second function, why doesn't "-x/2 - 1/2" become "-x - 1"? (Because both expressions have the same denominator.)
    Thanks!
    (7 votes)
    Default Khan Academy avatar avatar for user
  • hopper cool style avatar for user Niusha.hugo
    whats the difference between inverse function and reciprocal functions ?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • old spice man green style avatar for user Petrie (Peter S. Asiain III)
      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
      (7 votes)
  • piceratops ultimate style avatar for user Genius71752
    Why do you swap the y for the x? I would rather understand why than memorize.
    (4 votes)
    Default Khan Academy avatar avatar for user
    • purple pi pink style avatar for user Sebastian
      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.
      (6 votes)
  • orange juice squid orange style avatar for user Kevin Au
    What is the point of renaming f^-1 (y) to f^-1(x)? is it purely for graphing purposes to see what it looks like when we take an inverse of a function?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • female robot grace style avatar for user C C
      It is the conventional notation for inverse functions, so it is a good idea to get used to seeing that way. In terms of the math it doesn't make any difference what you call the variable as long as you're consistent.
      (2 votes)

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.