Republic of Mathematics blog

James Grime on connect the towns solution (Motorway Problem)

Posted by: Gary Ernest Davis on: July 30, 2011

James Grime – mathematician, nurse juggler and comedy nerd, Cambridge, UK – ( @jamesgrime on Twitter) has a lovely, and funny, video on the connect the towns by the shortest route problem. I think this is an outstanding example of mathematical exposition, and is EXACTLY what kids should be thinking abut in mathematics classes. Bravo James!

What do we need to solve quadratic equations?

Posted by: Gary Ernest Davis on: June 11, 2011

Completing the square

Evariste Galois

A former colleague wondered if the quadratic formula \frac{-b\pm \sqrt{b^2-4ac}}{2a} held when a, b, c are complex numbers.

He could, of course, have figured this out by the process of completing the square:

If a\neq 0 then ax^2+bx+c= 0 exactly when 4a^2x^2+4abx+4ac=0 (thanks to James Tanton for this trick).

This happens exactly when (2ax)^2+2b(2ax)+4ac=0 or, equivalently when [2ax+b]^2+4ac-b^2=0.

This leads us to the equivalent form [2ax+b]^2=b^2-4ac from which we deduce the quadratic formula.

What allows this to work?

What did we need to get this line of reasoning to work?

  1. We need to know that if a\neq 0 then ax^2+bx+c= 0 exactly when 4a^2x+4abx+4ac=0.  This means we can multiply and divide by non-zero quantities (as well as add and subtract).
  2. In exchanging 2b(2ax) for 4abx we are using commutativity of multiplication. We use this again in expanding the square [2ax+b]^2

In current mathematical parlance, this means the quantities a,b,c, x come from a field. Examples are the field of rational numbers, the field of real numbers, and the field of complex numbers.

Square roots

To take the final step from [2ax+b]^2=b^2-4ac to x=\frac{-b\pm \sqrt{b^2-4ac}}{2a} we need to be able to extract square roots. In the field of real numbers we can always do this for non-negative numbers, but already the field of rational numbers presents difficulties.  For the complex field we can always solve [2ax+b]^2=b^2-4ac for 2ax+b but the square root function does not exist as it does for positive real numbers.

A finite field

The numbers 0, 1, 2, 3, 4, 5, 6  where we add and multiply modulo 7 – keeping only the remainder after division by 7 – form a field, denoted \mathbf{Z}_7

The only point that might be in doubt is division by a non-zero quantity, but we can see this can always be carried out from the following table of multiplicative inverses:

x x^2

reason

1 1 1\times 1 =1 mod 7
2 4 2\times 4 =1 mod 7
3 5 3\times 5 =1 mod 7
4 2 4\times 2 =1 mod 7
5 3 5\times 3 =1 mod 7
6 6 6\times 6 =1 mod 7

So to solve a quadratic equation ax^2+bx+c= 0 where the quantities a,b,c, x come from \mathbf{Z}_7 we can reach the step [2ax+b]^2=b^2-4ac and then wonder if we can always solve this equation.

For example if try to solve the quadratic equation x^2+x+1= 0 where x come from \mathbf{Z}_7 we reach the step [2x+1]^2=-3=4 mod 7.

What solutions, if any, are there to z^2=4 mod 7?

x x^2
1 1
2 4
3 2
4 2
5 4
6 1

So there are two solutions for 2x+1 to [2x+1]^2=-3=4: 2x+1=2, 2x+1=5.

This gives 2x=1 or 2x=4 so that x=4 or x=2

Quadratic residues

We can replace the number 7, above, by any prime number p to get a field denoted \mathbf{Z}_p.

The existence of multiplicative inverses follows from Euclid’s algorithm, and when p is not a prime number it’s easy to see that division by non-zero quantities in \mathbf{Z}_p is not always possible.

When the equation z^2=d has a solution in , the number d is called a quadratic residue mod p.

Determining which numbers are quadratic residues  mod p is a solved, but interesting, problem that is an excellent investigation for students, and it comes simply out of trying to solve quadratic equations over these fields.

Finite fields

But this does not exhaust the finite fields, and for every prime number p and positive integer r there is a field – known as a Galois field – with p^r elements.

So now we want to know under what conditions we can solve z^2=d where z, d come from a finite field.

Rational numbers

When the quantities a, b, c ,x are rational numbers we again have the question of whether the equation [2x+1]^2=b^2-4ac has a rational number solution for x
This, of course boils down to whenz^2=d has a rational number solution when d is a rational number – that is, to when square roots of positive rational numbers are again rational numbers.

The moral?

Thinking about exactly what we need to solve a quadratic equation leads us straightforwardly to solving quadratic equations over less often encountered number fields, which in turn leads us directly to interesting and deep questions of number theory, which, nevertheless, are capable of being investigated by school students.

Investigating quadratic residues mod p, p prime, might also lead to more respect for the subtle intricacies of the square root as a function. The answer to z^2=d is not resolved by simply writing z=\pm\sqrt{d}.