## What is a polynomial?

A polynomial is a mathematical expression that contains more than two algebraic terms. It is a sum of several terms that contain different powers of the same variable. $p\left(x\right)$ is the representation of a polynomial. A polynomial expression representation consists of at least one variable, and typically includes constants and positive constants as well. It is represented as ${a}_{1}{x}^{n}+{a}_{2}{x}^{n-1}+{a}_{3}{x}^{n-2}+.............+{a}_{n}{x}^{0}$, where $x$ is the variable, $\left({a}_{1},{a}_{2},{a}_{3},....................,{a}_{n}\right)$ are the coefficients and $\text{n}$ is the degree of the polynomial. The coefficients must be a real number.

It is necessary for the polynomial expression that each expression consists of two parts:

- Coefficient part
- Exponent part

**Example**:

$p\left(x\right)=21{x}^{3}+3{x}^{2}+14{x}^{1}+21{x}^{0}$. Here, 21, 3, 14, and 21 are the coefficients, and 3,2,1 and 0 are the exponential values$x$.

## Types of polynomials

### Monomial

It has only one term, like 2x, 23xy.

### Binomial

It has two terms, or we can say that it is the sum of two monomials; for example, 2x+3.

### Trinomial

It consists of three terms of monomials; for example, 2x+3y+7z.

## Matrix representation of a polynomial

Consider a polynomial equation $p\left(x+y\right)={\left(ax+by\right)}^{2}$. It can be written as:

$p\left(x,y\right)={\left(\left[\begin{array}{cc}a& b\end{array}\right]\left[\begin{array}{c}x\\ y\end{array}\right]\right)}^{2}$.

It can be written as ${v}^{T}Mv$. Here, $v={\left[\begin{array}{cc}x& y\end{array}\right]}^{T}$, and $M=\left[\begin{array}{cc}{a}^{2}& ab\\ ab& {b}^{2}\end{array}\right]$.

But how do we find the value of $M$. Furthermore, Here $p\left(x,y\right)$ has degree 2. It is represented as the multiplication of matrix and vector,

Important Point- If $M=\left({m}_{ij}\right)$, then

${v}^{T}Mv=\sum _{ij}{m}_{ij}{v}_{i}{v}_{j}$

Then compare the coefficients of ${v}_{i}{v}_{j}\forall i,j$ both sides of the equation to get ${m}_{ij}$.

$\left[\begin{array}{cc}a& b\end{array}\right]\left[\begin{array}{c}x\\ y\end{array}\right]=\left[\begin{array}{cc}x& y\end{array}\right]\left[\begin{array}{c}a\\ b\end{array}\right]$,

then $M=\left[\begin{array}{cc}a& b\end{array}\right]\left[\begin{array}{c}a\\ b\end{array}\right]$.

Let us assume that $v=\left[\begin{array}{c}x\\ y\end{array}\right]\text{and}A=\left[\begin{array}{cc}a& b\end{array}\right]$.

From the first line, we note that:

$Av={v}^{T}{A}^{T}$ , and hence that

${\left(Av\right)}^{2}={\left(Av\right)}^{T}\left(Av\right)\phantom{\rule{0ex}{0ex}}={v}^{T}{A}^{T}AV\phantom{\rule{0ex}{0ex}}={v}^{T}\left({A}^{T}A\right)v\phantom{\rule{0ex}{0ex}}\text{So}M={A}^{T}A$

It is a matrix representation of the polynomial.

## Vector space of polynomials

The n degree polynomial is a function that is represented as:

$p\left(x\right)={a}_{0}+{a}_{1}x+{a}_{2}{x}^{2}+.......+{a}_{n}{x}^{n}$, where $\left({a}_{0},{a}_{1},{a}_{2},.......,{a}_{n},\right)$ is the coefficient of a real number, and n is degree.

Polynomials are represented by the vector of their coefficients in a vector space:

$\text{u}=\left[\begin{array}{c}{a}_{0}\\ {a}_{1}\\ {a}_{3}\\ .\\ {a}_{4}\end{array}\right]$

## Representation of polynomial

There are various ways to represent the polynomials, two of which are given below.

- Using array
- Using a linked list

### Representation of polynomial equation using array

The operations such as addition, subtraction, multiplication, differentiation and so forth can be performed on the polynomials represented as arrays.

**Example:**

Consider a polynomial with two variables: $2{x}^{2}+5xy+{y}^{2}$.

The array representation of the polynomial is give below:

2 | 2 | 0 | 5 | 1 | 1 | 1 | 0 | 2 |

Index 0 stores the coefficient of the first term, index 1 stores the exponent of the variable x and index 2 stores the exponent of the variable y in the first term. The process is repeated for the remaining terms in the polynomial.

It can also be represented as a 2-dimentional array as follows:

${y}^{0}$ | ${y}^{1}$ | ${y}^{2}$ | |

${x}^{0}$ | 0 | 0 | 1 |

${x}^{1}$ | 0 | 5 | 0 |

${x}^{2}$ | 2 | 0 | 0 |

**Representation of polynomial with single variable -**

Consider a polynomial $-4+7x+6{x}^{2}$ then we can write as: $-4{x}^{0}+7{x}^{1}+6{x}^{2}$

For the one-dimensional array, store the coefficients in the index given by the coefficient of the polynomial.

In the array representation, the array first the first element stores the coefficient of the term with the lowest exponent and the last element contains the coefficient of the term with the highest exponent.

The above diagram shows the array representation of polynomial. A polynomial of a single variable $A\left(X\right)$ can be written as ${a}_{0}+{a}_{1}{X}^{1}+{a}_{2}{X}^{2}+{a}_{3}{X}^{3}+.........+{a}_{n}{X}^{n}$ where ${a}_{n}\ne 0$ and degree of $A\left(X\right)$ is n. Here ${a}_{0},{a}_{1},{a}_{2},......{a}_{n}$ is the coefficient of respective terms.

The polynomial is represented using an array of size n which has n+1 terms.

### Polynomial Addition using Array

Consider two different polynomials ${X}_{1}=3{x}^{1}+5{x}^{2}+7{x}^{3}$ and ${X}_{2}=7{x}^{0}+3{x}^{1}+4{x}^{2}$. The degree of ${X}_{1}$ is 3 and the degree of ${X}_{2}$ is 2. The steps to add the polynomials are listed below.

- First identify the highest degree polynomial. The degree of the resultant polynomial is same as the polynomial with the highest degree.
- Store the coefficient in the index specified by the exponents of the polynomial.
- Add the coefficients stored in one array with the corresponding index positions in the other array and store the result in the same index position in the resultant array.

## Representation of polynomial using linked list

An ordered list of non-zero terms can be thought of as a polynomial. Each non-zero term consists of three sections namely coefficient part, exponent part, and then a pointer pointing to the node containing the next term of the polynomial.

Let's take an example-

If the polynomial is $2{x}^{2}+3x+4$, then it is written in the form of $2{x}^{2}+3{x}^{1}+4{x}^{0}$ and represented it using a linked list. In the diagram, AON means "address of next node".

The above diagram shows the linked list representation of polynomial. A polynomial of a single variable can be written as ${a}_{0}+{a}_{1}{X}^{1}+{a}_{2}{X}^{2}+{a}_{3}{X}^{3}+.........+{a}_{n}{X}^{n}$ where ${a}_{n}\ne 0$ and degree of $A\left(X\right)$ is n. Here ${a}_{0},{a}_{1},{a}_{2},......{a}_{n}$ is the coefficient of respective terms.

### Addition of polynomials represented as linked lists

Consider the polynomials $12{x}^{4}+2{x}^{2}+10$ and $9{x}^{3}+8{x}^{2}+x$.

The addition of linked list is done by three cases-

**Case 1:**

If the exponent of the node pointed by j of ${X}_{2}$ is less than the exponent of the current node pointed by *i* of ${X}_{1}$, then copy the value of current node of ${X}_{1}$ pointed by* i* in the new node. If the new node is the first node, make it pointed by ${X}_{3}$ and a pointer *k.* Otherwise, add the new node next to the last node.

**Case 2:**

If the exponent of the node pointed by j of ${X}_{2}$ is greater than the exponent of the current node pointed by i of ${X}_{1}$, then copy the value of the current node ${X}_{2}$ pointed by j in the new node. If the new node is the first node, make it pointed by ${X}_{3}$ and a pointer k. Otherwise, add the new node next to the last node.

**Case 3:**

If the exponent of two terms of polynomials ${X}_{1}and{X}_{2}$ is equal, then the coefficients are added, and the new term is stored in the resultant polynomial ${X}_{3}$ and advance i, j and k to move to the next node.

## Common Mistakes

There are some common mistakes made in the polynomial. When expanding a binomial raised to a power, students frequently make the error of "distributing the exponent," which is comparable to distributing a coefficient. Here's an illustration:

$\begin{array}{rcl}{(x-2)}^{2}& =& {x}^{2}-{2}^{2}\\ & =& {x}^{2}-4\end{array}$

This is a wrong calculation. Remember that squaring a polynomial is the same as multiplying it by itself. If we perform the same thing with this binomial, we get the following:

$\begin{array}{rcl}{(x-2)}^{2}& =& x(x-2)-2(x-2)\text{Distributeitone}(x+5)\text{factor}\\ & =& {x}^{2}-2x-2x+2\xb72\\ & =& {x}^{2}-4x+4\text{Thisisa}\text{Correctanswer}\end{array}$

The outcomes are not the same. Remember that the word "distribute" refers to multiplication, not exponents or powers. Note that we could have multiplied the two polynomials with FOIL as well. When factoring a sum or difference of squares, the same mistake is committed in reverse:

${x}^{2}+9={(x+3)}^{2}$ ===> Incorrect

or ${x}^{2}-9={(x-3)}^{2}$ ===> Incorrect

There is no factoring formula that uses the "sum of squares." There is, however, a factoring formula based on "difference of squares"; though, the output is not the same binomial squared:

${x}^{2}-9=(x+3)(x-3)$ ==> correct

When asked to simplify an expression within a radical, another common error is to spread the root. As an example,

$\begin{array}{rcl}\sqrt{{x}^{2}+9}& =& \sqrt{{x}^{2}}+\sqrt{9}\\ & =& x+3\end{array}$ Incorrect!!!

Since we cannot factor ${x}^{2}+9$.

We didn't write it as a square or some other equation, so the square root can't be calculated.

## Context and Applications

This topic is very useful for under graduation and post graduation also. Especially for,

- Bachelor degree in Computer Science
- Bachelor degree in Electronics engineering
- Master in Computer science

## Related Concepts

- Polynomial representation in data structure
- Polynomial in one variable
- Coefficient of polynomial

## Practice** **Problems

**Q1-** The Exponent of polynomial must be-

- Negative
- Non Negative
- None
- Complex number

**Correct answer: **Non negative

**Explanation**- For an algebraic expression to be a polynomial, all of the exponents in it must be non-negative integers. If an algebraic expression contains a radical, it isn't a polynomial, as a general rule.

**Q2- ${x}^{2}+2x+1$ **is a polynomial of-

- One variable
- Two variable
- Three variable
- Four variable

**Correct Answer- **One variable

**Explanation- **The expression contains only one variable$x$ x.

**Q3-** What is the way to represent a polynomial?

- Representation using Array
- Representation using linked list
- Both
- None

**Correct answer- **Both

**Explanation- **There are 2 ways to represent a polynomial and they are array and linked list.

**Q4- **What is the example of trinomial?

- $3x+6y+8{y}^{2}$
- $4x+2y+5z$
- $2{z}^{3}+3z+1$
- None

**Correct answer-** $4x+2y+5z$

**Explanation- **This expression contains 3 variables x, y and z.

**Q5- **Adding the polynomials require adding the ___________

- exponents of the corresponding terms
- coefficients of the corresponding terms
- both
- none

**Correct answer-** 2. coefficients of the corresponding terms

**Explanation- **The coefficient of the first polynomial is added with the coefficient of the corresponding term in the second polynomial to obtain the resultant polynomial.

### Want more help with your computer science homework?

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.

### Search. Solve. Succeed!

Study smarter access to millions of step-by step textbook solutions, our Q&A library, and AI powered Math Solver. Plus, you get 30 questions to ask an expert each month.

## Representation of Polynomial Homework Questions from Fellow Students

Browse our recently answered Representation of Polynomial homework questions.

### Search. Solve. Succeed!

Study smarter access to millions of step-by step textbook solutions, our Q&A library, and AI powered Math Solver. Plus, you get 30 questions to ask an expert each month.