# Brahmagupta-Fibonacci Identity/General

## General version of Brahmagupta-Fibonacci Identity

Let $a, b, c, d, n$ be numbers.

$\paren {a^2 + n b^2} \paren {c^2 + n d^2} = \paren {a c + n b d}^2 + n \paren {a d - b c}^2$

### Corollary

$\paren {a^2 + n b^2} \paren {c^2 + n d^2} = \paren {a c - n b d}^2 + n \paren {a d + b c}^2$

### Extension

Let $a_1, a_2, \ldots, a_n, b_1, b_2, \ldots, b_n, m$ be integers.

Then:

$\ds \prod_{j \mathop = 1}^n \paren { {a_j}^2 + m {b_j}^2} = c^2 + m d^2$

for some $c, d \in \Z$.

That is: the set of all integers of the form $a^2 + m b^2$ is closed under multiplication.

## Proof

 $\ds$  $\ds \paren {a c + n b d}^2 + n \paren {a d - b c}^2$ $\ds$ $=$ $\ds \paren {\paren {a c}^2 + 2 \paren {a c} \paren {n b d} + \paren {n b d}^2} + n \paren {\paren {a d}^2 - 2 \paren {a b} \paren {c d} + \paren {b c}^2}$ Square of Sum, Square of Difference $\ds$ $=$ $\ds a^2 c^2 + 2 n a b c d + n^2 b^2 d^2 + n a^2 d^2 - 2 n a b c d + n b^2 c^2$ multiplying out $\ds$ $=$ $\ds a^2 c^2 + n a^2 d^2 + n b^2 c^2 + n^2 b^2 d^2$ simplifying $\ds$ $=$ $\ds \paren {a^2 + n b^2} \paren {c^2 + n d^2}$

$\blacksquare$

## Source of Name

This entry was named for Brahmagupta‎ and Leonardo Fibonacci‎‎.