# 5.1: Add and Subtract Polynomials

https://www.applestemhomeschool.com/module/topic/218

## Adding and Subtracting Polynomials – Tutorial and Practice When we are adding or subtracting 2 or more polynomials, we have to first group the same variables (arguments) that have the same degrees and then add or subtract them. For example, if we have ax 3 in one polynomial (where a is some real number), we have to group it with bx 3 from the other polynomial (where b is also some real number). Here is one example with adding polynomials:</p>

We remove the brackets, and since we have a plus in front of every bracket, the signs in the polynomials don’t change.

We group variables with the same degrees : red is for second degree, and there we have -1+2, which is 1 and that’s how we got x 2 . Blue is for the first degree where we have 2+4 which is 6, and the green is for the constants (real numbers) where we have 3-5 which is -2.

The principle is the same with subtracting, only we have to keep in mind that a minus in front of the polynomial changes all signs in that polynomial. Here is one example:

<p>We remove the brackets, and since w degrees : there is no variable with the third degree in the second polynomial, so we just write 4x 3 . We group other variables the same way when we were adding polynomials.

### Adding and Subtracting Polynomials Practice Questions

1. Add polynomials -3x 2 +2x+6 and -x 2 -x-1.

a. -2x 2 +x+5
b. -4x 2 +x+5
c. -2x 2 +3x+5
d. -4x 2 +3x+5

2. Subtract polynomials 4x 3 -2x 2 -10 and 5x 3 +x 2 +x+5.

a. -x 3 -3x 2 -x-15
b. 9x 3 -3x 2 -x-15
c. -x 3 -x 2 +x-5
d. 9x 3 -x 2 +x+5

### Dividing Operations with Polynomials

3. Divide x 3 -3x 2 +3x-1 by x-1.

a. x 2 -1
b. x 2 +1
c. x 2 -2x+1
d. x 2 +2x+1

4. Divide x 2 -y 2 by x-y.

a. x-y
b. x+y
c. xy
d. y-x

1. B
-4x 2 +x+5
(-3x 2 +2x+6) + (-x 2 -x-1)=
-3x 2 +2x+6 -x 2 -x-1=
-4x 2 +x+5

We remove the brackets and we group the variables by degrees .

2. A
-x 3 -3x 2 -x-15
(4x 3 -2x 2 -10)-(5x 3 +x 2 +x+5)=
4x 3 -2x 2 -10-5x 3 -x 2 -x-5=
-x 3 -3x 2 -x-15

We remove the brackets, but we change all signs in the second polynomial because of the minus. Now we group the variables by degrees .

3. C
x 2 -2x+1
(x 3 -3x 2 +3x-1) : (x-1)= x 2 -2x+1
-(x 3 -x 2 )
-2x 2 +3x-1
-(-2x 2 +2x)
x-1
-(x-1)
0

4. B
x+y

(x 2 -y 2 ) : (x-y) =x+y
-(x 2 -xy)
xy-y 2
-(xy-y 2 )
0

Written by, Brian Stocker MA., Complete Test Preparation Inc.

Date Published: Thursday, April 3rd, 2014
Date Modified: Monday, January 25th, 2021

## Polynomial Operations Using Arrays

MATLAB has some convenient vector-based tools for working with polynomials, which are used in many advanced courses and applications in engineering. Type help polyfun for more information on this category of commands. We will use the following notation to describe a polynomial:

f(x) =alxn +a2Xn-1 + a3Xn-2 + … +an_Ix2 +anx + an+1

This polynomial is a function of x. Its degree or order is n, the highest power of x that appears in the polynomial. The a., i = 1,2, … , n + 1 are the polynomial’s coefficients. We can describe a polynomial in MATLAB with. a row vector whose elements are the polynomial’s coefficients, starting with the coefficient of the
highest power of x. This vector is [al. a2, a3, …• an-I, an, an+d. For example, the vector [4, – 8, 7 , – 5) represents the polynomial ax? – 8ࡨ +7x – 5. Polynomial roots can be found with the root s (a) function, where (a) is
the array containing the polynomial coefficients. For example, to obtain the roots of x3 + 12ࡨ +45x +50 = 0, you type y = root s ( [1, 12, 45, 50) ) . The answer (y) is a column array containing the values -2, -5, -5.
The poly (r) function computes the coefficients of the polynomial whose roots are specified by the array r. The result is a row array that contains the polynomial’s coefficients. (Note that the root s function returns it column array.) For example, to find the polynomial whose roots are I and 3 ± 5i, the session is
»r = [l,3+5i,3-5i)
»poly(r)
ans =

Thus the polynomial is x3 – 7ࡨ + 40x – 34. The two commands could have been combined into the single command poly ( [1, 3+ 5i, 3 – 5 i) ) .

To add two polynomials, add the arrays that describe their coefficients. If the polynomials are of different degrees, add zeros to the coefficient array of the lower-degree polynomial. For example, consider
f(x) = 9ࡩ
– 5ࡨ + 3x + 7
whose coefficient array is

f = [ 9 , – 5 , 3 , 7] and
g(x) = 6ࡨ – X + 2
whose coefficient array is g = [6, -1 , 2 ]. The degree of g(x) is one less that of f(x). Therefore, to add f(x) and g(x), we append one zero to g to “fool” MATLAB into thinking g(x) is a third-degree polynomial. That is, we
type g = [0 g] to obtain [0, 6 , -1, 2] for g. This vector represents g(x) = Ox3 + 6ࡨ – X + 2. To add the polynomials, type h = f+g. The result is h = [9,1,2,9], which corresponds to h(x) = 9ࡩ + x2 + 2x + 9. Subtraction is
done in a similar way:

Polynomial Multiplication and Division

To multiply a polynomial by a scalar, simply multiply the coefficient array by that ‘scalar. For example, 5th (x) is represented by [45, 5 , 10 , 45 J. . Multiplication of polynomials by hand can be tedious, and polynomial division
is even more so, but these operations are easily done with MATLAB. Use the cony function (it stands for “convolve”) to multiply polynomials and use the deconv function (deconv stands for “deconvolve”) to perform synthetic division. Table 2.5-1 summarizes these functions, as well as the poly, polyval,
and roots functions, which we saw. Table 2.5-1 Polynomial functions

The product of the polynomials f(x) and g(x) is f(x)g(x) = (9ࡩ – 5ࡨ + 3x + 7)(6ࡨ – X + 2) –
= 54࡫ – 39ࡪ + 41ࡩ + 29ࡨ – X + 14
Dividing f(x) by g(x) using synthetic division gives a quotient of f(x) 9ࡩ – 5ࡨ + 3x + 7
. = 1.5x – 0.5833 g(x) = 6ࡨ – X +2
with a remainder of -0.5833x +8.1667. Here is the MATLAB session to perform these operations.
»f = [9,-5,3,7] »g = [6 , -I, 2]
»product = conv (f,g) product’ =
54 -39 41 29 »[quotient,. remainder] =
quotient = 1.5 -0.5833
remainder = o 0
-1 14 deconv (f,g)
-0.5833 8.1667

The conv and deconv- functions do not require that the polynomials have the same degree, so we did not have to fool MATLAB as we did when adding the polynomials. Table 25-1 gives the general syntax for the cony and deconv functions.

Plotting Polynomials
The polyval (a, x’) function evaluates a polynomial at specified values of its independent variable x, which can be a matrix or a vector. The polynomial’s coefficient array is a. The result is the same size as x. For example, to evaluate the polynomial f(x) = 9ࡩ – 5ࡨ + 3x + 7 at the points x = 0,2,4, … ,10,
type »a = [9, – 5,3,7]
»x [0:2:10) »f polyval (a,x)
The resulting vector f contains six values that correspond to /(0). /(2), /(4) /(10). These three commands can be combined into a single command:

»f = poly val ([9,-5,3,7), [0:2:10))
Personal preference determines whether to combine terms in this way some people think that the single. combined command is less readable than three separate commands.

The poly val function is very useful for plotting polynomials. To do this you should define an array that contains many values of the independent variable x in order to obtain a smooth plot. For example, to plot the polynomial f(x) = 9ࡩ – 5ࡨ + 3x +7 for -2 :s x :s 5, you type
»a [9,-5,3,7) »x [-2:0.01:5)
»f polyval (a,x) »plot(x,f),xlabel (‘x’),ylabe1(‘f(x) ‘),grid

12.5-1 Use MATLAB to obtain the roots of

12.5-2 Use MATLAB to confirm that

T2.5-:3 Use MATLAB to confirm that
I2x3 + 5ࡨ – 2x +3 = 4x + II
3ࡨ -7x +4

## 5.1: Add and Subtract Polynomials Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers.
Example: Time Complexity: O(m + n) where m and n are number of nodes in first and second lists respectively.
Related Article: Add two polynomial numbers using Arrays
This article is contributed by Akash Gupta. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to [email protected] See your article appearing on the GeeksforGeeks main page and help other Geeks.

Attention reader! Don&rsquot stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.

## 5.1: Add and Subtract Polynomials

In this section we’re going to take a brief look at dividing polynomials. This is something that we’ll be doing off and on throughout the rest of this chapter and so we’ll need to be able to do this.

Let’s do a quick example to remind us how long division of polynomials works.

Let’s first get the problem set up.

Recall that we need to have the terms written down with the exponents in decreasing order and to make sure we don’t make any mistakes we add in any missing terms with a zero coefficient.

Now we ask ourselves what we need to multiply (x - 4) to get the first term in first polynomial. In this case that is (5). So multiply (x - 4) by (5) and subtract the results from the first polynomial.

The new polynomial is called the remainder. We continue the process until the degree of the remainder is less than the degree of the divisor, which is (x - 4) in this case. So, we need to continue until the degree of the remainder is less than 1.

Recall that the degree of a polynomial is the highest exponent in the polynomial. Also, recall that a constant is thought of as a polynomial of degree zero. Therefore, we’ll need to continue until we get a constant in this case.

Here is the rest of the work for this example.

Okay, now that we’ve gotten this done, let’s remember how we write the actual answer down. The answer is,

There is actually another way to write the answer from the previous example that we’re going to find much more useful, if for no other reason that it’s easier to write down. If we multiply both sides of the answer by (x - 4) we get,

[5 - + 6 = left( ight)left( <5+ 19x + 76> ight) + 310]

In this example we divided the polynomial by a linear polynomial in the form of (x - r) and we will be restricting ourselves to only these kinds of problems. Long division works for much more general division, but these are the kinds of problems we are going to seeing the later sections.

In fact, we will be seeing these kinds of divisions so often that we’d like a quicker and more efficient way of doing them. Luckily there is something out there called synthetic division that works wonderfully for these kinds of problems. In order to use synthetic division we must be dividing a polynomial by a linear term in the form (x - r). If we aren’t then it won’t work.

Let’s redo the previous problem with synthetic division to see how it works.

Okay with synthetic division we pretty much ignore all the (x)’s and just work with the numbers in the polynomials.

First, let’s notice that in this case r=4.

Now we need to set up the process. There are many different notations for doing this. We’ll be using the following notation.

The numbers to the right of the vertical bar are the coefficients of the terms in the polynomial written in order of decreasing exponent. Also notice that any missing terms are acknowledged with a coefficient of zero.

Now, it will probably be easier to write down the process and then explain it so here it is. The first thing we do is drop the first number in the top line straight down as shown. Then along each diagonal we multiply the starting number by (r) (which is 4 in this case) and put this number in the second row. Finally, add the numbers in the first and second row putting the results in the third row. We continue this until we get reach the final number in the first row.

Now, notice that the numbers in the bottom row are the coefficients of the quadratic polynomial from our answer written in order of decreasing exponent and the final number in the third row is the remainder.

The answer is then the same as the first example.

[5 - + 6 = left( ight)left( <5+ 19x + 76> ight) + 310]

We’ll do some more examples of synthetic division in a bit. However, we really should generalize things out a little first with the following fact.

#### Division Algorithm

Given a polynomial (P(x)) with degree at least 1 and any number (r) there is another polynomial (Q(x)), called the quotient, with degree one less than the degree of (P(x)) and a number (R), called the remainder, such that,

[Pleft( x ight) = left( ight)Qleft( x ight) + R]

Note as well that (Q(x)) and (R) are unique, or in other words, there is only one (Q(x)) and (R) that will work for a given (P(x)) and (r).

So, with the one example we’ve done to this point we can see that,

Now, let’s work a couple more synthetic division problems.

Okay in this case we need to be a little careful here. We MUST divide by a term in the form (x - r) in order for this to work and that minus sign is absolutely required. So, we’re first going to need to write (x + 2) as,

and in doing so we can see that (r = - 2).

We can now do synthetic division and this time we’ll just put up the results and leave it to you to check all the actual numbers.

[2 - 3x - 5 = left( ight)left( <2- 4x + 5> ight) - 15]

In this case we’ve got (r)=6. Here is the work.

In this case we then have.

[4 - 10 + 1 = left( ight)left( <4+ 24 + 134x + 804> ight) + 4825]

So, just why are we doing this? That’s a natural question at this point. One answer is that, down the road in a later section, we are going to want to get our hands on the (Q(x)). Just why we might want to do that will have to wait for an explanation until we get to that point.

There is also another reason for this that we are going to make heavy usage of later on. Let’s first start out with the division algorithm.

[Pleft( x ight) = left( ight)Qleft( x ight) + R]

Now, let’s evaluate the polynomial (P(x)) at (r). If we had an actual polynomial here we could evaluate (P(x)) directly of course, but let’s use the division algorithm and see what we get,

Now, that’s convenient. The remainder of the division algorithm is also the value of the polynomial evaluated at (r). So, from our previous examples we now know the following function evaluations.

This is a very quick method for evaluating polynomials. For polynomials with only a few terms and/or polynomials with “small” degree this may not be much quicker that evaluating them directly. However, if there are many terms in the polynomial and they have large degrees this can be much quicker and much less prone to mistakes than computing them directly.

As noted, we will be using this fact in a later section to greatly reduce the amount of work we’ll need to do in those problems.

Now we'll look at an application of this skill and use the vertical method to solve.

Great Job! You should now be ready for subtracting polynomials. Need More Help With Your Algebra Studies?

Not ready to subscribe?  Register for our FREE Pre-Algebra Refresher course.

#### ALGEBRA CLASS E-COURSE MEMBERS    To add polynomials, you can group like terms and then findtheir sum, or youcan write them in column form and then add. Tosubtract a polynomial, add its additive inverse, which is theopposite of each term in the polynomial.

Find each sum or difference.

B (12x + 7y ) - (- x + 2y )

Find the additive inverse of - x + 2y. Then group the liketerms and add. The additive inverse of - x + 2y is x - 2y.

## Real-World Example of Polynomial Trending Data

For example, polynomial trending would be apparent on the graph that shows the relationship between the profit of a new product and the number of years the product has been available. The trend would likely rise near the beginning of the graph, peak in the middle and then trend downward near the end. If the company revamps the product late in its life cycle, we'd expect to see this trend repeat itself.

This type of chart, which would have several waves on the graph, would be deemed to be a polynomial trend. An example of such polynomial trending can be seen in the example chart below:

## Estimating the Uncertainty in Measurements

Before you combine or do anything with your uncertainty, you have to determine the uncertainty in your original measurement. This often involves some subjective judgment. For example, if you’re measuring the diameter of a ball with a ruler, you need to think about how precisely you can really read the measurement. Are you confident you’re measuring from the edge of the ball? How precisely can you read the ruler? These are the types of questions you have to ask when estimating uncertainties.

In some cases you can easily estimate the uncertainty. For example, if you weigh something on a scale that measures down to the nearest 0.1 g, then you can confidently estimate that there is a ±0.05 g uncertainty in the measurement. This is because a 1.0 g measurement could really be anything from 0.95 g (rounded up) to just under 1.05 g (rounded down). In other cases, you’ll have to estimate it as well as possible on the basis of several factors.

Significant Figures: Generally, absolute uncertainties are only quoted to one significant figure, apart from occasionally when the first figure is 1. Because of the meaning of an uncertainty, it doesn’t make sense to quote your estimate to more precision than your uncertainty. For instance, a measurement of 1.543 ± 0.02 m doesn’t make any sense, because you aren’t sure of the second decimal place, so the third is essentially meaningless. The correct result to quote is 1.54 m ± 0.02 m.

## 5.1: Add and Subtract Polynomials

Adding & Subtracting Multiples and Near Multiples of 10:

• Adding More or Less (Emma Holiday)
• Mental Addition Beyond 10 (Pippa McKean)
• Add or subtract near multiples of 10 (Ian Mason) - Sheet 1- PDF - Sheet 2 - PDF
• Add or subtract multiples of 10 (Ian Mason) - Sheet 1 - PDF - Sheet 2 - PDF
• Adding Several Numbers (Ian Mason) PDF
• Adding 1, 10, 100 (Ian Mason) Sheet 1 PDF - Sheet 2 PDF
• Adding 5, 10 (Ian Mason) Sheet 1 PDF - Sheet 2 PDF
• Adding 11 (Ian Mason) PDF
• 1 Less 1 More (Gareth Rein) DOC
• 10 Less 10 More (Gareth Rein) DOC
• Adding on 9 more (Gareth Rein) DOC
• Adding on 10s & 100s (Paula Whysall) PDF
• Adding 10 and 20 (Lynne Hardwidge) PDF
• Adding 10 (Laura Christmas) DOC
• Adding to 1000 (Multiples of 50) (Vicki Foy) PDF
• Add & Subtract 9, 11 (Kathy Leah) DOC
• Add & Subtract 1, 10 and 100 (Andrew Woodcock) XLS
• Add TU + U (Andrew Woodcock) XLS
• More and Less (Shirley Lehmann)
• Adding Multiples of 10 and 100 (Meryl York) DOC
• Adding & Subtracting 1, 10 and 100 (Annalise Roberts)
• Near Multiples Game (John Morris) DOC
• Adding 9, 19, 11, 21 (Lisa Newman) DOC
• Adding Multiples of 10, 100 and 1000 (Lisa Newman) DOC
• Subtracting Tens (Karen Walmsley) DOC
• Mental Addition (TU+TU) (Cathryn Jones)
• Adding 9 and 11 (Lynne Hardwidge) PDF
• Adding 9 and 11 (interactive) (Louise Cosby) XLS
• Adding and Taking Away 10 (Gareth Rein) DOC
• Adding on 10 (Gareth Rein) DOC
• Adding on 10 (easy) (Gareth Rein) DOC
• 10 Less (Interactive Excel) (James Almond) XLS
• Adding and Subtracting 1 - Sheet 1 (Lynne) PDF
• Adding and Subtracting 1 - Sheet 2 (Lynne) PDF
• Adding and Subtracting 10 (Lynne) PDF
• Adding and Subtracting 100 (Lynne) PDF
• Add/Subtract 9 & 11 (Barbara Grayson) DOC
• Subtracting 10, 11, 12 (Nicola McCrum) DOC
• Adding 9 & 11 to 2 digit numbers using a numberline (Rebecca Denyer) DOC
• Adding 1 More (Dice) (Gemma Thomas) DOC
• Add Multiples of 10 (Andrew Woodcock) XLS
• Add Multiples of 5 (Andrew Woodcock) XLS
• Adding on 50 (Gemma Stevens) DOC
• Adding and Subtracting 10 Word Problems (Karen Jupp) DOC
• Take Away 9 or 11 (Alison Porter) DOC
• Taking away 10 and 11 Using a 200 Rectangle (Rona Dixon) DOC
• Adding Multiples of 10 (Garden Centre Prices) (Sarah Gunston)
• Add and Subtract HTU numbers using a numberline (Neil Roberts) DOC
• Subtracting 9, 11, 19 and 21 (Karen Walmsley) DOC Partitioning, Bridging & Counting On:

• Partitioning 2 & 3 digit numbers for addition (Debbie Jones)
• Partition (addition) (Hamish Hobkinson) PDF
• Simple Partitioning (Liz Hazelden) DOC
• Bridging through 10 (Shelley Parsons)
• Adding in Parts (Lisa Heap) PDF
• Subtraction by Counting on (Sean McCarthy)
• Numberline Strategies (Counting Up) (Amani El-Alawneh)
• Subtraction using a Numberline (Gareth Williams)
• Jumping the Number Line (Lisa Heap) PDF
• Using number lines to find the difference (Mandy Smith) PDF
• Addition - Partition and Numberline (James Hopkins) DOC
• Subtraction - Counting On (Andrew Woodcock)
• Partition and Bridge (Jean Simpson) DOC
• Numberline Addition and Subtraction (Carrie Magee) DOC
• Addition by Partitioning HTU (Michelle Coventry)
• Subtraction with Number Lines (<20) (Rebecca Hall) DOC
• Add and Subtract 2-digits without crossing the 10 (Kath Gardener) DOC
• Partitioning to Add (TU+U/TU+TU) (Jenni Dumbleton) DOC
• Addition Using Partitioning (Auveen Twomey)
• Addition by Paritioning (T2 Day 1 - 5) (Louise Cosby)
• Bridging through 10 (Rachael Wilkie) DOC
• Addition & Subtraction (T2 Unit 2 Day 1 - 5) (Louise Cosby)
• Linear Addition (Gareth Rein) DOC
• Addition and Subtraction (counting up) (David Guest) PDF
• Shopkeeper's Subtraction (Suzanne Edwards) PDF
• Numberline Addition (Caroline Barriball) DOC
• Bridging through 10 (Emma Foster) PDF
• Subtraction - Counting On (Andrew Woodcock) XLS
• Subtraction by Addition (within 10, 20) (Jean Simpson) DOC
• Number Line Addition & Subtraction (Mark Bravey) DOC
• Adding 1 digit to 2 digit Numbers (Emma Holliday)
• Finding the Difference by Counting On (Michelle Coventry)
• Subtracting Two 2-digit Numbers (Alison Porter)
• Addition to 20 with Number Lines (Rebecca Hall) DOC
• Subtraction by Counting On (Karen Walmsley) DOC
• Addition using a Number Line (Chelsea Arnold) DOC • Adding 3 Numbers (Gilbert Ivens)
• Twenties (Ian Mason) Sheet 1 PDF - Sheet 2 PDF
• Adding 3 Numbers up to 15 & 20 (Margaret-Anne McGinley) DOC
• Adding 3 Numbers Game (Vicki Foy) PDF
• Telephone Number Challenge (Louise Pickering) PDF
• Adding Several Numbers (LA) (Jocelyn Hook) DOC
• Adding 3 Numbers within 10 (Philomena Shotton)
• Adding 3 Numbers (Making 10 First) (Whitehall Infant School)
• Adding Single Digit Numbers (Ian Mason) PDF
• Totalling 20 (Vicki Foy) DOC
• Adding 3 or 4 Numbers (Shazia Hussain) DOC • Inverse Operations (Debbie Jones)
• Reverse Addition (Lynne Hardwidge) PDF
• Reverse Subtraction (Lynne Hardwidge) PDF
• Subtraction as the Inverse of Addition (Jane Ibe) DOC
• Function Machines (Paula Whysall) PDF
• The Inverse Monster (Antoinette Payne) DOC
• Inverse Number Sentences (Lucy Garside) DOC Other Mental Strategies:

• Unit 3: Understanding Addition and Subtraction (Dot Hullah)
• Addition & Subtraction (T1 Unit 11 Day 1 - 5) (Fred Daynes)
• Number Blast Addition (Reuben McIntyre)
• Numbers near 100 (Lisa Heap) PDF
• 3 Minute Mental +/- (Kirsty Router) DOC
• Mental Addition and Subtraction Sheet 1 PDF Sheet 2 PDF
• Simple Mental Calculation Sheets (Laura Collins) DOC
• T1 U2: Addition & Subtraction (David Arthur)
• T2 U2 Addition & Subtraction (David Arthur) 