# Maths - Powers of Quaternions

We want to calculate an expression for:

(a + i b + j c + k d)n

where n is an integer.

When we calculated the powers of complex numbers we used the binomial theorem:

(a + i b)n=
 n ∑ k=0
 n! (n-k)! k!
(-i)k a n-k bk

However there are a couple of differences in this case: these are 4 terms instead of 2 (so we would have to use a quadnomial instead of a binomial) but more importantly the terms don't all commute so we must use all permutations rather than integer multiplications of combinations which the binomial theorem gives.

see combinatorics

## Square

So lets try the simplest case where: (a + i b + j c + k d)²

Taking all the permutations gives:

permutation dimension
a a 1 commutes
a b i commutes
a c j commutes
a d k commutes
b a i commutes
b b -1 commutes
b c ij = k anti-commutes
b d ik -j anti-commutes
c a j commutes
c b ji =-k anti-commutes
c c -1 commutes
c d jk = i anti-commutes
d a k commutes
d b ki = j commutes
d c kj = -i anti-commutes
d d -1 anti-commutes

The anti-commuting values cancel out so taking the other terms gives:

(a + i b + j c + k d)² = a²-b²-c²-d² + i 2ab + j 2ac + k 2ad

Going on to higher powers gives:

n (a + i b + j c + k d)n w x y z
1 (a + i b + j c + k d)1 a b c d
2 (a + i b + j c + k d)2 a²-b²-c²-d² 2ab 2ac 2ad
3 (a + i b + j c + k d)3 a3-3b²a-3c²a -3d²a 3a²b-b3-3c²a-3d²a 3a²c-c3-3b²c-3d²c 3a²d-d3-3b²d-3c²d
4 (a + i b + j c + k d)4