Prelude and Fugue in D major, BWV 532

Johann Sebastian Bach's Prelude and Fugue in D major, BWV 532.2 (previously 532), is a prelude and fugue written for the organ , and has an approximate duration of minutes. BWV 532.1 (previously 532/2a) is an earlier version of the Fugue.
History.
The Fugue in D major, BWV 532a, was composed around 1708. It is an earlier version of fugue of BWV 532. Not much is known about this fugue, other than that it was composed around 2 years before the Prelude and Fugue in D Major, and was written and premiered in Weimar. Also BWV 532 was written during Bach's tenure in Weimar: it was composed between 1709 and 1717. Many of his greatest and most well known organ works were written during this period, including, for example, the Prelude and Fugue in E major, BWV 566. The composer was residing in Weimar after being hired by the ruling duke of Weimar, Wilhelm Ernst, in 1709 as an organist and member of the court orchestra; he was particularly encouraged to make use of his unique talents with the organ by the duke. Indeed, his fame on the instrument grew and he was visited by many students of the organ to hear him play and to try to learn from his technique. The "Prelude and Fugue in D major" was probably composed in 1710, although this is not certain. What we do know is that BWV 532 features a lengthy, complex, self-contained fugue preceded by a multisectional prelude. Thus it must have been written before Bach codified the clear two-section prelude and fugue form used in The Well-Tempered Clavier, which was composed in 1722. 
Structure.
The piece is in two sections: a prelude and a fugue. Both the sections are in D major but, to begin with, there is no tempo marking given on either section. Both pieces are in 4/4.
Prelude.
The prelude commences with a semi-quaver scale from the pedals, and then the manuals begin with an intricate quaver pattern between the hands. Another run from the pedals is then followed by a continuation of the quaver pattern from the right-hand. The quaver pattern then repeats one octave lower. The pedals then play arpeggiated patterns which begin a repeated theme and slow down throughout. This lasts for four bars. A sustained pedal then accompanies the manuals, which have a dotted quaver, semi-quaver rhythm. This then turns into a repeated "G♯, B" demi-semi-quaver rhythm. This then slows to a series of repeated cadences.
A new phrase then begins with an ascending scale in the manuals leading up to a large D major chord. A new tempo is then introduced: "Alla breve", and then a large phrase is introduced with a very polyphonic texture and a prominent tune. A section then starts with chords played in the manuals and the quavers played in the pedals. This continues for another long period of time until the left hand takes the tune and the right hand plays the quavers.
When this section finishes, a new tempo of "Adagio" begins. A new theme then arrives with slow quavers on the lower manual and pedal and ascending scales in the upper manual. The prelude then concludes with a slow theme, on broken arpeggios and some slow, elongated final chords.
Fugue.
The subject of this fugue is eight measures long and consists of tight figurations encompassing the interval of a ninth. Bach takes this subject firstly through the relative minor and then the mediant minor, and then to the minor harmony of the leading tone and the major harmony on the supertonic. After this progression we enter an episode with a flurry of figures on the dominant and then a full entry of the subject on the tonic that works to resolve the preceding tension so well that the eventual coda almost has the nature of an afterthought. 
The subjects of both the BWV 532a and 532 fugues are identical, as well are the counter-subject introduction in the alto voice, and then also in the tenor voice. The fugue in BWV 532a is identical to the one of BWV 532 until the 28th measure (7 measures after the introduction of the subject in the pedals).
Transcriptions.
This work has been transcribed for solo piano by Ferruccio Busoni as BV B 20 in 1888, and by Eugen d'Albert in 1893.