R: Multiplying Polynomials

polymul {pracma} | R Documentation

## Multiplying Polynomials

### Description

Multiply two polynomials given as vectors.

### Usage

      polymul(p, q)

### Arguments

`p, q` | Vectors representing two polynomials.

### Details

Polynomial multiplication realized simply by multiplying and summing up all the coefficients.

### Value

Vector representing a polynomial.

### Note

`conv` also realizes polynomial multiplication, through Fast Fourier Transformation, with the drawback that small imaginary parts may evolve.

### See Also

`conv`, `deconv`

### Examples

    # Multiply x^2 + x + 1 with itself
    polymul(c(1, 1, 1), c(0, 1, 1, 1))  #=> 1 2 3 2 1

[Package pracma version 2.0.4 Index]