Serotonergic neurons mediate unexpected exposure increases in escape latencies and enhancement of place memory. (A) Flies were exposed to 32°C to activate the Trh-GAL4-positive neurons with UAS-TrpA1 expression, which increased escape latencies (H(5, N = 35809) = 1259.8, p < 0.0001; P < 0.01 = ** experimental flies with unexpected exposure compared to control genotypes and non-exposed flies after multiple comparisons). (B) Flies were exposed to 15°C cool temperatures to activate the Trh-GAL4 neurons with UAS-TrpM8, which increased escape latencies (H(3, N = 11681) = 384.3, p < 0.0001; P < 0.01 = ** experimental flies with unexpected exposure compared to control genotypes and non-exposed flies after multiple comparisons). (C) Flies expressing the TrpA1 in serotonergic neurons with the Trh-GAL4 driver had an enhanced memory after unexpected exposure to a warm temperature compared to genetic control flies (H(5, N = 737) = 31.9, p < 0.0001; P < 0.001 = *** compared to all other groups after multiple comparisons). (D) Flies expressing the cool responsive TrpM8 with the Trh-GAL4 driver (Trh-GAL4/TrpM8 (■)) had enhanced memory levels compared to genetic control flies (Trh-GAL4/+ (•) and UAS-TrpM8/+(▲)) and GAL4/TrpM8 flies not exposed to a low temperature (▼) (15°C, H(3, N = 516) = 48.1, p < 0.0001; 16°C, H(3, N = 536) = 17.5, p = 0.0006; 17°C, H(3, N = 514) = 3.6, p = 0.3; P’s < 0.001 = *** and < 0.05 = * of the experimental genotype with exposure compared to all other groups with multiple comparisons).