# Brahmagupta polynomials

Brahmagupta polynomials are a class of polynomials associated with the Brahmagupa matrix which in turn is associated with the Brahmagupta's identity. The concept and terminology were introduced by E. R. Suryanarayan, University of Rhode Island, Kingston in a paper published in 1996. These polynomials have several interesting properties and have found applications in tiling problems and in the problem of finding Heronian triangles in which the lengths of the sides are consecutive integers.

## Definition
### Brahmagupta's identity

In algebra, Brahmagupta's identity says that, for given integer N, the product of two numbers of the form $x^{2}-Ny^{2}$ is again a number of the form. More precisely, we have
    $(x_{1}^{2}-Ny_{1}^{2})(x_{2}^{2}-Ny_{2}^{2})=(x_{1}x_{2}+Ny_{1}y_{2})^{2}-N(x_{1}y_{2}+x_{2}y_{1})^{2}.$
This identity can be used to generate infinitely many solutions to the Pell's equation. It can also be used to generate successively better rational approximations to square roots of arbitrary integers.

### Brahmagupta matrix

If, for an arbitrary real number $t$, we define the matrix
    $B(x,y)={\begin{bmatrix}x&y\\ty&x\end{bmatrix}}$
then, Brahmagupta's identity can be expressed in the following form:
    $\det B(x_{1},y_{1})\det B(x_{2},y_{2})=\det(B(x_{1},y_{1})B(x_{2},y_{2}))$
The matrix $B(x,y)$ is called the Brahmagupta matrix.

### Brahmagupta polynomials

Let $B=B(x,y)$ be as above. Then, it can be seen by induction that the matrix $B^{n}$ can be written in the form
    $B^{n}={\begin{bmatrix}x_{n}&y_{n}\\ty_{n}&x_{n}\end{bmatrix}}$
Here, $x_{n}$ and $y_{n}$ are polynomials in $x,y,t$. These polynomials are called the Brahmagupta polynomials. The first few of the polynomials are listed below:
    ${\begin{alignedat}{2}x_{1}&=x&y_{1}&=y\\x_{2}&=x^{2}+ty^{2}&y_{2}&=2xy\\x_{3}&=x^{3}+3txy^{2}&y_{3}&=3x^{2}y+ty^{3}\\x_{4}&=x^{4}+6t^{2}x^{2}y^{2}+t^{2}y^{4}\qquad &y_{4}&=4x^{3}y+4txy^{3}\end{alignedat}}$

## Properties

A few elementary properties of the Brahmagupta polynomials are summarized here. More advanced properties are discussed in the paper by Suryanarayan.

### Recurrence relations

The polynomials $x_{n}$ and $y_{n}$ satisfy the following recurrence relations:
* $x_{n+1}=xx_{n}+tyy_{n}$
* $y_{n+1}=xy_{n}+yx_{n}$
* $x_{n+1}=2xx_{n}-(x^{2}-ty^{2})x_{n-1}$
* $y_{n+1}=2xy_{n}-(x^{2}-ty^{2})y_{n-1}$
* $x_{2n}=x_{n}^{2}+ty_{n}^{2}$
* $y_{2n}=2x_{n}y_{n}$

### Exact expressions

The eigenvalues of $B(x,y)$ are $x\pm y{\sqrt {t}}$ and the corresponding eigenvectors are $[1,\pm {\sqrt {t}}]^{T}$. Hence
    $B[1,\pm {\sqrt {t}}]^{T}=(x\pm y{\sqrt {t}})[1,\pm {\sqrt {t}}]^{T}$.
It follows that
    $B^{n}[1,\pm {\sqrt {t}}]^{T}=(x\pm y{\sqrt {t}})^{n}[1,\pm {\sqrt {t}}]^{T}$.
This yields the following exact expressions for $x_{n}$ and $y_{n}$:
* $x_{n}={\tfrac {1}{2}}{\big(x+y{\sqrt {t}})^{n}+(x-y{\sqrt {t}})^{n}{\big ]}$
* $y_{n}={\tfrac {1}{2{\sqrt {t}}}}{\big(x+y{\sqrt {t}})^{n}-(x-y{\sqrt {t}})^{n}{\big ]}$
Expanding the powers in the above exact expressions using the binomial theorem and simplifying one gets the following expressions for $x_{n}$ and $y_{n}$:
* $x_{n}=x^{n}+t{n \choose 2}x^{n-2}y^{2}+t^{2}{n \choose 4}x^{n-4}y^{4}+\cdots$
* $y_{n}=nx^{n-1}y+t{n \choose 3}x^{n-3}y^{3}+t^{2}{n \choose 5}x^{n-5}y^{5}+\cdots$

### Special cases

* If $x=y={\tfrac {1}{2}}$ and $t=5$ then, for $n>0$:
          $2y_{n}=F_{n}$ is the Fibonacci sequence $1,1,2,3,5,8,13,21,34,55,\ldots$.
          $2x_{n}=L_{n}$ is the Lucas sequence $2,1,3,4,7,11,18,29,47,76,123,\ldots$.
* If we set $x=y=1$ and $t=2$, then:
          $x_{n}=1,1,3,7,17,41,99,239,577,\ldots$ which are the numerators of continued fraction convergents to ${\sqrt {2}}$. This is also the sequence of half Pell-Lucas numbers.
          $y_{n}=0,1,2,5,12,29,70,169,408,\ldots$ which is the sequence of Pell numbers.

### A differential equation

$x_{n}$ and $y_{n}$ are polynomial solutions of the following partial differential equation:
       $\left({\frac {\partial ^{2}}{\partial x^{2}}}-{\frac {1}{t}}{\frac {\partial ^{2}}{\partial y^{2}}}\right)U=0$