The following example is taken from Bach's Two-part Invention #1 in C major. The primary motive (or theme) is stated at A (identified by the letter M). This motive is divided into two parts, x and y, respectively. B illustrates the use of this motive in sequence (diatonic), ascending by thirds. Letter C is a simple restatement of the motive in another key. This is very common within the body of the composition. D illustrates the inversion (or mirroring) of the motive plus a restatement. E combines several techniques. First, the motive is fragmented (only the x portion is utilized). Second, the fragment is augmented. Note that the rhythmic values are twice a long as in the original. And finally, that augmentation is sequenced down a third. F utilizes the same techniques, except that it uses the inversion of the original motive. Finally, letter G inverts the original motive, then fragments it and sequences the y portion of the theme.
Along with motivic development, there are a couple of other structural concepts that play a significant role in understanding baroque melodies. The first of these concerns large-scale stepwise motion, often referred to as a step progression. While many melodies may seem to be quite disjunct, their basic underlying motion is essentially stepwise. The following example, from Bach's Concerto for Two Violins, BWV 1043, illutrates this concept. The melody is indicated by the notes with the stems down. As you look closely at the melody, notice the scalar motion created by the notes with the stems up. Essentially, this melody descends a d minor scale (including both versions of scale degrees 7 and 6. So, what on the surface seems quite disjunct is really based on a simple descending scale.
The final aspect is what is referred to as a compound melody. A compound melody is a single melodic line that is actually suggestive of two (or more) melodic lines. The following three examples illustrate this concept. In each, the upper staff is the original melody, the middle staff is the original melody broken up into two component melodies, with the appropriate rhythmic changes. The lower staff is a pitch reduction. This shows the essential melodic motion of the component melodies without the rhythmic elements. Whenever you are studying a melody that is quite disjunct, it's very possible that you may be dealing with a compound melody.