Why does the liquid change color?
We have previously prepared five glasses, each with a few drops of different substances, and then added the solution of thymol blue to each of them. In each glass we get a different solution; molecules of thymol blue have fallen into diverse neighborhoods, and therefore they have behaved differently.
Let us analyze in detail what happened in each glass. We will mark the thymol as “Ind” (Indicator).
Glass #1 (red)
In the first glass we put 5 drops of sodium hydrogen sulfate NaHSO4 water solution. In water it dissociates cheerfully into three charged particles (called ions):
NaHSO4 → Na+ + H+ + SO42-
In the presence of a large quantity of protons H+, all of the thymol blue (Ind2- – blue) becomes red H2Ind.
Glass #2 (orange)
Citric acid C6H8O7 from the second glass also dissociates in water, producing protons H+. Moreover, each of its molecules can form a whole three H+! But, unlike NaHSO4, citric acid does it so unwillingly, that as a result much less H+ appears in the solution than in the first case. Therefore, a part of thymol blue becomes red H2Ind, and another part becomes yellow HInd-. A mixture of yellow and red, just as when we mix paint colors, gives us orange.
Glass #3 (yellow)
In the third glass, a mixture of citric acid C6H8O7 and sodium carbonate Na2CO3 produces even fewer protons H+. Therefore, all the thymol blue in such a neighborhood turns into yellow HInd-.
Glass #4 (green)
Sodium chloride NaCl in water dissociates into Na+ and Cl-. But the water itself, as a matter of fact, contains a small number of protons H+ (read more on that topic in Addition to this question). Therefore, we get a slightly green colored solution from yellow HInd- and blue Ind2-.
Glass #5 (blue)
In the last glass, thymol blue is present in its own form Ind2- and has, as its name suggests, the blue color.