I thought you'd never ask! ;)
When I retired almost 4 years ago, I decided to take up playing the piano again. I played pretty well when I was a lot younger, and passed the Guildhall's Diploma (LGSM) exam in piano teaching in 1981. But then, I just drifted away from it. I had what had been a lovely old piano, an 1891 Bechstein model 8 that was reconditioned in about 1978. But that had seen better days (4 kids all learning to play on it, and especially my younger son, who is a pretty accomplished jazz pianist). So when I retired, I bought a really nice 1936 Blüthner grand and started practising.
Around the same time Andras Schiff played the entirety of Bach's first book of preludes & fugues at the proms, from memory - about 2 hours' music. I watched the entire concert utterly captivated - I'd played a couple of these in the past, but had never listened to the whole lot all the way through before, and I found the last one, in B minor, the most fascinating of the lot. There's a lot of mystery, and history, to Bach's 48 preludes & fugues. They weren't published until 1801, 51 years after his death, and no-one knows precisely why he wrote them. But they were ground-breaking as he wrote, in each book, one in every major and one in every minor key. That's why the German term for the 48 is "Wohltemperierte Klavier" - well-tempered (tuned) keyboard. For reasons of SCIENCE, which Bach clearly understood, it's not possible for every key to be in tune with itself and a well-tuned keyboard is always a compromise.
I decided to learn the B minor fugue. It's very odd - not really great listening music unless you like your brain thoroughly challenged. In the first 3 bars, he explores all 12 notes of the chromatic scale, most unusual for early 18th century music (he wrote book 1 around 1720-23) and not really seen again until Schönberg in the early 20th century. As I say, I started to learn this, and after a week or so of playing it every day, I had this odd feeling that it reminded me of something, another piece, but I couldn't place what. After another week or so, the penny dropped: it was a gigue in G major by Mozart, K 574 (most composers have opus numbers, Mozart Köchel numbers) written on 17th May 1798 (Mozart was very kind to musicians and kept a record of dates and locations of pretty well everything he wrote). I had played this gigue in 1971 for my Associated Board grade 7 exam when I was about 17, and it was kind of my party piece when I got to college. If you are familiar with Mozart's music, you'd not guess it was Mozart - it almost sounds 20th century (see my comment about Schönberg above). But the opening subject of the Mozart is a direct lift from the Bach B minor fugue: all he has done, in effect, is speed it up and change the time signature. Of course, I was intrigued, so I started reading a bit about the Mozart gigue.
Considering it's only 38 bars and takes about 90 seconds to play, lots of people have written lots of words about the Mozart, largely because of its weirdness. But the most important fact was that he wrote it in Leipzig, the day after performing/improvising on the organ at the Thomaskirche, which had been Bach's place of work from 1723 until his death. It was Mozart's only visit to the city: well, he went twice, en route from Vienna to Berlin and back, and he was looked after by the Leipzig Court Organist, one Karl Engel. Mozart wrote the gigue into Engel's family album to express gratitude for his host's hospitality. Of course, Engel would have been steeped in Bach's music from an early age.
But the more I read, the more I realised that no-one had spotted the similarity between the two pieces. The earliest reference I could find was the biography of Mozart by Otto Jahn (published 1855 or so) in which there was a quote about "when Mozart improvises, even trained musicians find it difficult to identify the piece on which he's based his improvisation". There was a much more recent biographer and music historian, Charles Rosenberg, who said it was similar to a Haydn string quartet (it is), but he freely admitted that he had no idea why Mozart would write a piece in honour of Haydn in Leipzig, Bach's stronghold. There's a Handel gigue in F minor which bears some similarities, but the same applies. Handel spent most of his life in London. Another guy, USAnian William Kinderman, wrote a recent book entitled "Mozart's Piano Music" and he said that, although clearly in the style of Bach, it bore no similarities to any known Bach work.And I found a blogger who said something along the lines that "Maybe the notes flew into Mozart's head after a night of claret and billiards" (Mozart was fond of both).
I've scoured the internet, and discussed it with a much more skilled musician than myself, who was very sceptical about my findings until he sat down to analyse the Mozart, and he found a lot of further harmonic similarities that I hadn't spotted. There's no question - Mozart definitely based it on the Bach fugue. We know he studied the preludes and fugues in the early 1780s as a guest of the Baron von Swieten, who had a copy (apparently Bach used to make his students copy his works longhand so there are copies about, just not printed ones until much later - again, 10 years after Mozart's death in 1791). Despite a lot of googling, I've found no reference anywhere on the internet that anyone else has spotted the link. Even Tchaikowsky orchestrated the gigue for a movement of his piece "Mozartiana", and Busoni, (1866-1924) based some variations on it. But there's no evidence that I can find that anyone else has spotted the link between the two pieces.
So I'm claiming the discovery for myself! Some clever buggers get degrees and doctorates for their original research, but since no-one has offered me one, I've commemorated it in a watch.