Jump to content
  • Advertisement
Sign in to follow this  
hellz

Subtracting Polynomials

This topic is 5088 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, Right, after Fruny helped me yesterday, I managed to progress 10 or so pages and everything seemed fine. However, I've come across an example problem from the book, in which my answer differs. Here's the example:
(x² - 3x³ + 4x) - (x³ - 2x + y - 3x²)
And here's my working:
   (x² - 3x³ + 4x) - (x³ - 2x + y - 3x²) = 
  (x² - 3x³ + 4x) + (-x³ + 2x - y + 3x²) = 
       x² - 3x³ + 4x - x³ + 2x - y + 3x² = 
(x² + 3x²) - (-3x³ - x³) + (4x + 2x) - y = 
                      4x² + 4x³ + 6x - y
However, the book notes the answer as being:
-4x³ + 4x² + 6x - y
I don't understand how this result has been reached. When reading the book, it's said to perform subtraction by adding the additive inverse, which is how I've come up with:
(x² + 3x²) - (-3x³ - x³) = 4x² + 4x³
I mean I can see why 4x³ should be on the left-hand side, being as addition is commutative and the book says to re-arrange in exponential order, but how come 4x³ has been negated? I tried working it out by plugging in real values, and the results are vastly different:
x = 2, y = 3

      4x² - (-4x³) + 6x - y =
4(2)² - (-4(2)³) + 6(2) - 3 = 
  4(4) - (-4(8)) + 6(2) - 3 = 
        16 - (-32) + 12 - 3 = 
           16 + 32 + 12 - 3 = 57

      -4x³ + 4x² + 6x - y = 
-4(2)³ + 4(2)² + 6(2) - 3 = 
  -4(8) + 4(4) + 6(2) - 3 = 
        -32 + 16 + 12 - 3 = -5
Could someone explain what I'm missing please? [smile] Thanks in advance, -hellz

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by hellz

(x² - 3x³ + 4x) - (x³ - 2x + y - 3x²) =
(x² - 3x³ + 4x) + (-x³ + 2x - y + 3x²) =
x² - 3x³ + 4x - x³ + 2x - y + 3x² =
(x² + 3x²) - (-3x³ - x³) + (4x + 2x) - y =
4x² + 4x³ + 6x - y


However, the book notes the answer as being:


-4x³ + 4x² + 6x - y


You just missed a sign.

(x² - 3x³ + 4x) - (x³ - 2x + y - 3x²) =
(x² - 3x³ + 4x) + (-x³ + 2x - y + 3x²) =
x² - 3x³ + 4x - x³ + 2x - y + 3x² =
(x² + 3x²) + (-3x³ - x³) + (4x + 2x) - y = <--- note the +
4x² - 4x³ + 6x - y

Share this post


Link to post
Share on other sites
You have the most common error in maths: a wrong signal :)


The error lies in the passage from the 3rd to the 4th steps:

x² - 3x³ + 4x - x³ + 2x - y + 3x² =
(x² + 3x²) - (-3x³ - x³) + (4x + 2x) - y

"- (-3x³ - x³)" should be "+ (-3x³ - x³)".


More to the point, this is wrong:
(x² + 3x²) - (-3x³ - x³) = 4x² + 4x³

the correct thing is:
(x² + 3x²) - (-3x³ - x³) = 4x² - 4x³

[Edit: beaten by _DarkWIng_ :) ]

Share this post


Link to post
Share on other sites
Thanks for the replies guys. I'm not sure I fully understand, though.

When I re-arranged the like terms, I got from start-finish, like so:


x² - 3x³ + 4x - x³ + 2x - y + 3x²

x² + 3x² - 3x³ - x³ + 4x + 2x - y


That subsequently turned into:


(x² + 3x²) - (-3x³ - x³) + (4x + 2x) - y


Now, when you subtract a polynomial, you have to change all the minus signs outside of the parenthesis, to additions, correct? OK, so with that, that should turn into this, as stated earlier:


(x² + 3x²) + (-3x³ - x³) + (4x + 2x) - y


So how come in this other example, this happens:


(3a² + ab - b²) - (4ab - b² + 2a²) =
(3a² + ab - b²) + (-4ab + b² - 2a²) =
3a² + ab - b² - 4ab + b² - 2a² =
(3a² - 2a²) + (ab - 4ab) - (-b² + b²) = <-- last binomial.
a² + (-3ab) =
a² - 3ab


Apparently I got that example correct, but wouldn't that mean I should've worked it out as:


(3a² - 2a²) + (ab - 4ab) + (b² - b²) = <-- last binomial.


Eh wait, I can see why that'd give the same result. Am I right in what I've just stated?

Thanks ever so much for the replies,

-hellz

Share this post


Link to post
Share on other sites
Actually, if that is true, then that line I originally had wrong, should be this:

(x² + 3x²) + (-3x³ + -x³) + (4x + 2x) - y =

-hellz

Share this post


Link to post
Share on other sites
Quote:
Original post by hellz
Now, when you subtract a polynomial, you have to change all the minus signs outside of the parenthesis, to additions, correct?


Your statement is not very clear.
-(a+b) can be seen as -1*(a+b), distributing trough the parenthesis gives -(a+b) = -a-b. Again, -(-a-b) = a+b.
So, if you are switching the sign in front of a parenthesis you should switch signs of all terms within that parenthesis.

x² + 3x² - 3x³ - x³ + 4x + 2x - y = <- Note, see *
(x² + 3x²) + (-3x³ - x³) + (4x + 2x) - y =
(x² + 3x²) - (3x³ + x³) + (4x + 2x) - y =
(4x²) - (4x³) + (6x) - y =
- 4x³ + 4x² + 6x - y

* The first x³ coefficient here is -3.

Share this post


Link to post
Share on other sites
Thanks for the reply dude. [smile]

Hmm, that sort of makes sense, but here's one thing I don't understand:

Quote:
Original post by b34r
So, if you are switching the sign in front of a parenthesis you should switch signs of all terms within that parenthesis.

x² + 3x² - 3x³ - x³ + 4x + 2x - y = <- Note, see *
(x² + 3x²) + (-3x³ - x³) + (4x + 2x) - y =


When you changed the sign for this:

x² + 3x² - 3x³ - x³
(x² + 3x²) + (-3x³ - x³)

How come you didn't change the second line to:

(x² + 3x²) + (-3x³ + x³)

Surely you haven't switched the signs of all terms in that group of parenthesis?

Sorry for harping on about this, but I'm getting a tad confused. [wow] Thanks again, though. [smile]

-hellz

Share this post


Link to post
Share on other sites
Quote:
Original post by hellz
When you changed the sign for this:

x² + 3x² - 3x³ - x³
(x² + 3x²) + (-3x³ - x³)

How come you didn't change the second line to:

(x² + 3x²) + (-3x³ + x³)

Surely you haven't switched the signs of all terms in that group of parenthesis?


That's because he just grouped the terms together, there was no sign change involved at all.

Share this post


Link to post
Share on other sites
b34r didn't do that because that would not be correct.

This is correct:
x² + 3x² - 3x³ - x³ =
(x² + 3x²) + (-3x³ - x³)

This is incorrect:
x² + 3x² - 3x³ - x³ =
(x² + 3x²) + (-3x³ + x³)

Perhaps you're confunding the logic of the sigs. Don't worry, because at first it's normal. After a few times you'll do it right from instinct.

Consider:
A + B - C - D

Let's take the '+' into evidence:
+ ( A + B - C - D)

Let's take the '-' into evidence (this, i think is what is confusing you):
- ( -A - B + C + D)

Whenever you have a "-X", it's equivalent to having "(-1)*(+X)" wich is equivalent to "(-1)*X".

So

- ( -A - B + C + D)
= (-1)*( (-1)*A + (-1)*B + C + D)
= (-1)*(-1)*A + (-1)*(-1)*B + (-1)*C + (-1)*D
= A + B - C - D

Therefore, A + B - C - D = -(-A -B +C + D)

So
x² + 3x² - 3x³ - x³ =
(x² + 3x²) + (-3x³ - x³)

When i was first learning this stuff, it helped me to, at first, replace -A by (-1)*A. After a while i dropped this because i did it by instict. Remember that having "A+B" is equal to "1*A+1*B" and "A-B" is equal to "A+(-1)*B").


[Edit: beaten again, this time by Fruny !]

Share this post


Link to post
Share on other sites
Right, things are making more sense now. Thanks for all the help folks! I think I should re-read this entire chapter, though, just to be sure (probably be a mistake reading on just now I think).

Thanks for the help. [smile]

-hellz

Share this post


Link to post
Share on other sites

This topic is 5088 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!