# Reciprocal polynomial

In algebra, given a polynomial
    $p(x)=a_{0}+a_{1}x+a_{2}x^{2}+\cdots +a_{n}x^{n},$
with coefficients from an arbitrary field, its reciprocal polynomial or reflected polynomial, denoted by p$^∗$ or p$^R$, is the polynomial
    $p^{*}(x)=a_{n}+a_{n-1}x+\cdots +a_{0}x^{n}=x^{n}p(x^{-1}).$
That is, the coefficients of p$^∗$ are the coefficients of p in reverse order. Reciprocal polynomials arise naturally in linear algebra as the characteristic polynomial of the inverse of a matrix.
In the special case where the field is the complex numbers, when
    $p(z)=a_{0}+a_{1}z+a_{2}z^{2}+\cdots +a_{n}z^{n},$
the conjugate reciprocal polynomial, denoted p$^†$, is defined by,
    $p^{\dagger }(z)={\overline {a_{n}}}+{\overline {a_{n-1}}}z+\cdots +{\overline {a_{0}}}z^{n}=z^{n}{\overline {p({\bar {z}}^{-1})}},$
where ${\overline {a_{i}}}$ denotes the complex conjugate of $a_{i}$, and is also called the reciprocal polynomial when no confusion can arise.
A polynomial p is called self-reciprocal or palindromic if p(x) = p$^∗$(x). The coefficients of a self-reciprocal polynomial satisfy a$_i$ = a$_{n−i}$ for all i.

## Properties

Reciprocal polynomials have several connections with their original polynomials, including:
* deg p = deg p$^∗$ if $a_{0}$ is not 0.
* p(x) = x$^n$p$^∗$(x$^{−1}$).
* α is a root of a polynomial p if and only if α$^{−1}$ is a root of p$^∗$.
* If x ∤ p(x) then p is irreducible if and only if p$^∗$ is irreducible.
* p is primitive if and only if p$^∗$ is primitive.
Other properties of reciprocal polynomials may be obtained, for instance:
* A self-reciprocal polynomial of odd degree is divisible by x+1, hence is not irreducible if its degree is > 1.

## Palindromic and antipalindromic polynomials

A self-reciprocal polynomial is also called palindromic because its coefficients, when the polynomial is written in the order of ascending or descending powers, form a palindrome. That is, if
    $P(x)=\sum _{i=0}^{n}a_{i}x^{i}$
is a polynomial of degree n, then P is palindromic if a$_i$ = a$_{n−i}$ for i = 0, 1, ..., n.
Similarly, a polynomial P of degree n is called antipalindromic if a$_i$ = −a$_{n−i}$ for i = 0, 1, ..., n. That is, a polynomial P is antipalindromic if P(x) = –P$^∗$(x).

### Examples

From the properties of the binomial coefficients, it follows that the polynomials P(x) = (x + 1)$^n$ are palindromic for all positive integers n, while the polynomials Q(x) = (x – 1)$^n$ are palindromic when n is even and antipalindromic when n is odd.
Other examples of palindromic polynomials include cyclotomic polynomials and Eulerian polynomials.

### Properties

* If a is a root of a polynomial that is either palindromic or antipalindromic, then ⁠1/a⁠ is also a root and has the same multiplicity.
* The converse is true: If for each root a of polynomial, the value ⁠1/a⁠ is also a root of the same multiplicity, then the polynomial is either palindromic or antipalindromic.
* For any polynomial q, the polynomial q + q$^∗$ is palindromic and the polynomial q − q$^∗$ is antipalindromic.
* It follows that any polynomial q can be written as the sum of a palindromic and an antipalindromic polynomial, since q = (q + q$^∗$)/2 + (q − q$^∗$)/2.
* The product of two palindromic or antipalindromic polynomials is palindromic.
* The product of a palindromic polynomial and an antipalindromic polynomial is antipalindromic.
* A palindromic polynomial of odd degree is a multiple of x + 1 (it has –1 as a root) and its quotient by x + 1 is also palindromic.
* An antipalindromic polynomial over a field k with odd characteristic is a multiple of x – 1 (it has 1 as a root) and its quotient by x – 1 is palindromic.
* An antipalindromic polynomial of even degree is a multiple of x$^2$ – 1 (it has −1 and 1 as roots) and its quotient by x$^2$ – 1 is palindromic.
* If p(x) is a palindromic polynomial of even degree 2d, then there is a polynomial q of degree d such that p(x) = x$^d$q(x + ⁠1/x⁠).
* If p(x) is a monic antipalindromic polynomial of even degree 2d over a field k of odd characteristic, then it can be written uniquely as p(x) = x$^d$(Q(x) − Q(⁠1/x⁠)), where Q is a monic polynomial of degree d with no constant term.
* If an antipalindromic polynomial P has even degree 2n over a field k of odd characteristic, then its "middle" coefficient (of power n) is 0 since a$_n$ = −a$_{2n–n}$.

### Real coefficients

A polynomial with real coefficients all of whose complex roots lie on the unit circle in the complex plane (that is, all the roots have modulus 1) is either palindromic or antipalindromic.

## Conjugate reciprocal polynomials

A polynomial is conjugate reciprocal if $p(x)\equiv p^{\dagger }(x)$ and self-inversive if $p(x)=\omega p^{\dagger }(x)$ for a scale factor ω on the unit circle.
If p(z) is the minimal polynomial of z$_0$ with |z$_0$| = 1, z$_0$ ≠ 1, and p(z) has real coefficients, then p(z) is self-reciprocal. This follows because
    $z_{0}^{n}{\overline {p(1/{\bar {z_{0}}})}}=z_{0}^{n}{\overline {p(z_{0})}}=z_{0}^{n}{\bar {0}}=0.$
So z$_0$ is a root of the polynomial $z^{n}{\overline {p({\bar {z}}^{-1})}}$ which has degree n. But, the minimal polynomial is unique, hence
    $cp(z)=z^{n}{\overline {p({\bar {z}}^{-1})}}$
for some constant c, i.e. $ca_{i}={\overline {a_{n-i}}}=a_{n-i}$. Sum from i = 0 to n and note that 1 is not a root of p. We conclude that c = 1.
A consequence is that the cyclotomic polynomials Φ$_n$ are self-reciprocal for n > 1. This is used in the special number field sieve to allow numbers of the form x$^{11}$ ± 1, x$^{13}$ ± 1, x$^{15}$ ± 1 and x$^{21}$ ± 1 to be factored taking advantage of the algebraic factors by using polynomials of degree 5, 6, 4 and 6 respectively – note that φ (Euler's totient function) of the exponents are 10, 12, 8 and 12.
Per Cohn's theorem, a self-inversive polynomial has as many roots in the unit disk $\{z\in \mathbb {C} :|z|<1\}$ as the reciprocal polynomial of its derivative.

## Application in coding theory

The reciprocal polynomial finds a use in the theory of cyclic error correcting codes. Suppose x$^n$ − 1 can be factored into the product of two polynomials, say x$^n$ − 1 = g(x)p(x). When g(x) generates a cyclic code C, then the reciprocal polynomial p$^∗$ generates C$^⊥$, the orthogonal complement of C. Also, C is self-orthogonal (that is, C ⊆ C$^⊥$), if and only if p$^∗$ divides g(x).