The History of Toulouse - Decline and Recovery
Merovingian Franks
With Toulouse falling under the "control" of the Franks, Toulouse suffered like the rest of the Frankish kingdom from a decline in education, literacy, trade, and culture, along with bad weather, famines, and plagues. Being far from the seat of Frankish power, they invariably became an unimportant backwater to whatever Frankish brother was trying to wrest control of the kingdom (or whatever Frankish brother was trying to keep control of the kingdom).
By 680, infighting and the practice of Frankish princes delegating work to Dukes led to Felix, Duke of Aquitaine and Vasconia, becoming virtually independent. The dukes were not recognized as independent, but were largely unhindered in their rule from Toulouse.
The independence of the Dukes of Aquitaine would be shattered when the Arabs arrived. Visigothic Narbonne fell in 718, and Duke Odo of Aquitaine found himself outnumbered as the Arabs laid siege to Toulouse in 721. Leaving the city to the siege, Odo first looked to the Franks for support, but was rebuffed - the Franks wanted to use this chance to recover Aquitaine. Instead, Odo raised armies from his lands and from the Gascons, and crushed the Arabs at the Battle of Toulouse on June 9, 721.
To protect his lands, Odo allied with the Muslim ruler of Catalonia. This backfired when said ruler revolted and was crushed, leading the new wali of al-Andalus to decide to punish Odo for his victory a decade prior. Rather than attack from Narbonne, the Arabs took Bordeaux and struck towards Tours. Odo, out of men and allies, was forced again to ask the Franks for help.
This time, Charles Martel chose to act, and his army slaughtered the Arabs at Poitiers on October 25th, 732. This brought Odo under nominal rule of the Franks, and permanently checked Arab gains in the west.
The Franks, under Pippin the Short, now focused on bringing Aquitaine to heel. They captured Narbonne from the Arabs in 759, surrounding Aquitaine from 3 sides, and began a brutal 8 year campaign to subdue Aquitaine, succeeding finally in 760.
Kingdom of Aquitaine
With the death of Pippin, Charlemagne rose to power. In 778, he invaded Spain, and upon his return, his rear guard was set upon at Roncevaux by Basque warriors. This made it clear that the area was not truly under Frankish control.
In 781, he created the Kingdom of Aquitaine, including Aquitaine, Gascony, and the Mediterranian coast, and gave the crown to his 3 year old son, Louis. Toulouse became the central staging point for repeated invasions south into Spain, resulting in the conquests of Barcelona and much of Catalonia in 801.
Due to the Frankish custom of gavelkind succession, Charlemagne's massive empire again split up and reformed as emperors and kings died and their sons replaced them. The empire's sole ability to maintain a grip on power was that the King appointed the succession of the counties and duchies. Unfortunately, in the mid 9th Century, Charles the Bald was unable to protect his empire from Viking raiders, moving authority and protection downward to the counts. In 877, he was forced to sign the Capitulary of Quierzy, formalizing the custom of counties being passed down by inheritance, and paving the way for the feudal system. With the death of Louis the Stammerer in 879, the Kingdom of Aquitaine ceased to exist, with power devolving to lesser duchies and counties.
"County" of Toulouse
With the end of the Kingdom of Aquitaine, Toulouse was no longer the capital of a client kingdom, but an independent county surrounded by other power-hungry independent counties. The Counts of Auvergne challenged the Counts of Toulouse and even took Toulouse for a short period of time, only to die out in 918, with their lands going to the Count of Toulouse. While the Duchy of Aquitaine was self-created in the 890's by William the Pious of Auvergne (and later handed out to a King's favorite decades later), for all practical purposes, it would never again assert control over Toulouse.
Unfortunately, the 10th century was unkind to France in general, and Toulouse in particular. The Counts of Toulouse owned a huge swath of land on paper, but was unable to assert control outside their own estates - to the point that they even lost control of the city of Toulouse to an independent viscount. As if they didn't have enough troubles, the Caliph of Cordoba invaded in 920 and (possibly 929), and the Maygars invaded from the east in 924. Toulouse had truly reached a dark age.
Recovery?
While Toulouse had massive problems (depopulated countryside, abandoned churches and farms, disrupted trade, no control), they had several unique advantages over their neighbors to the north. Toulouse still operated under Visgothic/Roman Law, had cultural and trade ties to Muslim Spain, and had considerable freedom. While she was not in the best of shape, the same could be said for her neighbors...