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

Linear equations with unknown coefficients

Sal solves the equations ax+3x=bx+5 and a(5-x)=bx-8 for x. Note that these equations include other unknowns (a and b) but we solve them for x.

Want to join the conversation?

  • starky tree style avatar for user Mohammed Taqee
    At , where x = 8 + 5a over a + b, can't we just divide 5a in the numerator by a in the denominator, which would leave us with 5?
    (60 votes)
    Default Khan Academy avatar avatar for user
    • orange juice squid orange style avatar for user Kushagra Mittal
      You cant divide 5a in the numerator with a in the denominator.
      This is because in the numerator and denominator there are no multiplication or division signs.
      If u cant understand that, here is another example without variables: 5+5/5 = 10/5 = 2.
      You cant cancel the all the 5s in this to be left with 1 + 1/1 = 2/1 = 1 OR two fives to be left with 5+1/1 = 6/1 = 6. Just like that, u can not canel the a's in 8+5a/a+b
      If this is still unclear, you should do the multiplication and division course of fractions on KhanAcademy
      (29 votes)
  • starky ultimate style avatar for user AliAfrose
    Why did Sal changed from negative ax+bx in to positive ax+bx
    (32 votes)
    Default Khan Academy avatar avatar for user
    • purple pi purple style avatar for user doctorfoxphd
      He did this to avoid having to do this step
      x(- a - b)/ (- a - b) = (- 8 - 5a)/ (- a - b)
      and avoid having to simplify this answer:
      x = (- 8 - 5a)/ (- a - b)
      Lots of tricky negatives to deal with! Instead, he multiplied the whole thing, both sides of the equation, by negative 1 and that changes each sign. In this case, all terms become positive. That makes it less likely to make a mistake dealing with each negative sign.
      (49 votes)
  • spunky sam blue style avatar for user mtchuenkam
    I don't understand how at he just randomly decides to multiply by 1. where did that come from and why did he do it it's confusing to me?
    (16 votes)
    Default Khan Academy avatar avatar for user
    • stelly orange style avatar for user Megane Thomas
      Sal only multiplied by negative one to turn all of his negative terms to positive ones, to make it easier to work with. If at some point while you are working out your equation, you realize all your terms are negative, then you can multiply all your terms on both sides of the equation by negative 1. It will only change the sign, not the equality as long as you do it to all terms on BOTH sides of the equations. But like I said, all your terms have to be negative in the first place otherwise it defeats the purpose of multiplying by negative one, which is to make it easier to work with the figures.
      (39 votes)
  • hopper jumping style avatar for user Shubhra Mishra
    In the second example how do you make the (-ax - bx) to (ax + bx) and the (-8 -5a ) to (8 + 5a)?
    (20 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user AIDANG
    When will we use this in the real world?
    (23 votes)
    Default Khan Academy avatar avatar for user
  • starky tree style avatar for user Aadi Desai
    Do you have to multiply all of the numbers on by -1? Would it be wrong if I got x= -8-5a/-a-b
    (12 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      It is not wrong, it is just incomplete because there is a common factor of -1 in both the numerator and denominator. These should be factored out and cancelled with each other.
      x = [-1(8+5a)] / [-1(a+b)}
      The -1's divide out to 1, leaving you with the same answer as in the video.
      Sal noticed all the negatives earlier in his process (at about in the video) and he multiplies both sides of the equation by -1 to clear out all the negatives.

      Hope this helps.
      (21 votes)
  • blobby green style avatar for user BwizGoal
    At , why is he allowed to multiply both sides by -1? Where did the -1 come from? Please Answer
    (9 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      You are always allowed to multiply any whole equation (he states this as multiplying both sides) by any number to get an equivalent equation. The reason he chose -1 is because he noticed that all the terms are negative, and it is easier to work with positive numbers than with negative numbers.
      (15 votes)
  • male robot hal style avatar for user alex
    At Sal divides both sides by an Algebraic Expression, (a+b).
    Isn't that problematic? I'm aware there is a rule in math, not to divide by a Variable or Algebraic Expression unless you are sure that said variable/expression is not equal to zero.

    In this case, we're not sure that (a+b) is not 0, so if it was 0, we'd end up dividing by zero in this case.

    Is my logic wrong?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user Alex
      It can't be because a number cannot be divided by zero, not making a+b 0. So lets say you want to divide (a) apples between 0 friends, you can't divide it by 0 as you have 0 friends to share your apples with, so it can never be 0.

      PS: On calculators if you divide something by 0 it sometimes comes up as infinity
      (4 votes)
  • old spice man green style avatar for user - -
    At : Is the order of operations important? Do I first subtract 5a from both sides and then factor out -ax -bx? Or can I first factor out and then subtract like so:

    a(5-x) = bx - 8
    5a - ax = bx - 8 | -bx
    -ax -bx + 5a = -8
    x(-a-b) + 5a = -8
    x + 5a = (-8 / (-a - b))
    x = (-8 / (-a - b)) - 5a

    Or is this solution still correct, just not as "elegant" as it could be?
    (7 votes)
    Default Khan Academy avatar avatar for user
    • leafers ultimate style avatar for user Christelle Winter
      The order of operations are not important but you made some errors in your calculations:
      Up to your fourth line you're good: x(-a-b) + 5a = -8,
      But then if you want to divide by (-a-b) you need to divide all parts of the equation by (-a-b):
      x(-a-b)/ (-a-b) +5a/(-a-b) = -8/(-a-b)
      this simplifies as: x + 5a/(-a-b) = -8/(-a-b)
      Then you can substract 5a/(-a-b) from both sides and you have:
      x = -8/(-a-b) -5a/(-a-b)
      Which simplify as:
      x = (-8 -5a)/(-a-b)
      Then to get to Sal's answer you can multiply both sides by (-1)/(-1), which gives:
      x = (8+5a)/(a+b)

      Hope that helps!
      (11 votes)
  • piceratops tree style avatar for user AryanBoss12345
    if all the variables have an lcm can you simplify it?
    (5 votes)
    Default Khan Academy avatar avatar for user

Video transcript

- [Voiceover] So we have an equation. It says, a-x plus three-x is equal to b-x plus five. And what I want to do together is to solve for x, and if we solve for x it's going to be in terms of a, b, and other numbers. So pause the video and see if you can do that. All right now, let's do this together, and what I'm going to do, is I'm gonna try to group all of the x-terms, let's group all the x-terms on the left-hand side. So, I already have a-x and three-x on the left-hand side. Let's get b-x onto the left-hand side as well, and I can do that by subtracting b-x from both sides. And if I subtract b-x from both sides, I'm going to get on the right-hand side, I'm going to have a, or on the left-hand side, a-x plus three-x minus b-x, so I can do that in that color for fun, minus b-x, and that's going to be equal to... Well, b-x minus b-x is just zero, and I have five. It is equal to five. And now what I can do is, I can factor an x out of this left-hand side of this equation, out of all of the terms. So, I can rewrite this as x times... Well, a-x divided by x is a. Three-x divided by x is three, and then negative b-x divided by x is just going to be negative b. I could keep writing it in that pink color. And that's all going to be equal to five. And now, to solve for x I can just divide both sides by, the thing that x is being multiplied by, by a plus three minus b. So, I can divide both sides by a plus three minus b. A plus three minus b. On this side, they cancel out. And, I have x is equal to five over a plus three minus b, and we are done. Let's do one more of these. So, another equation here. We have a... Here we have a times the quantity, five minus x, is equal to b-x minus eight. So, once again, pause the video and see if you can solve for x. Well, the way I like to approach these is let's just expand everything all out. So, let me just distribute this a, and then I'm gonna collect all the x-terms on one side, and all of the non-x-terms on the other side, and essentially do what I just did in the last example. So, let's first distribute this a. So the left-hand side becomes five-a, I could say a times five or five-a, minus a-x, a-x, that is going to be equal to b-x minus eight. Now we can subtract b-x from both sides. So, we're gonna subtract b-x from the left-hand side, b-x from the right-hand side. And, once again, the whole reason I'm doing that, I want all the x-terms on the left, and all the non-x-terms on the right. And, actually, since I want all the non-x-terms on the right, I can actually subtract five-a from both sides, as well. So I'm kind of doing two steps at once, here, but hopefully it makes sense. I'm trying to get rid of the b-x here, and I'm trying to get rid of the five-a here. So, I subtract five-a there, and I'll subtract five-a there, and then let's see what this give us. So, the five-a's cancel out. And, on the left-hand side, I have negative a-x, negative a-x, minus b-x, minus, you know, in that same green color, minus b-x. And on the right-hand side, I have... This is going to be equal to, the b-x's cancel out, and I have negative eight minus five-a. Negative eight minus, in that same magenta color, minus five-a. And let's see, I have all my x's on one side, all my non-x's on the other side. And here I can factor out an x, and if I factor out an x, what do I have? And, actually, one thing that might be nice. Let me just multiply both sides by negative one. If I multiple both sides by negative one, I get a-x plus b-x, plus b-x is equal to eight plus five-a. That just gets rid of all of those negative signs. And now I can factor out an x here. So let me factor out an x, and I get x times a plus b. A plus b is going to be equal to eight plus five-a. Eight plus five-a. And we're in the home stretch now. We can just divide both sides by a plus b. So we could divide both sides by a plus b. A plus b. And we're going to be left with, x is equal to eight plus five-a, plus five-a, over... Actually, I'll write a and b in our original colors. A plus, so this was that a, that a, plus b. So this is the b, that's a and b, a plus b, and we're done. We have now solved for x in terms of a's and b's and other things. And we are all done.