What is a rainbow? What makes a Rainbow? Why do we find joy in a rainbow? Well I can only answer a few of these question. Rainbows as we know occur after a it rains and it’s sunny, therefore rainbows must be the effect of diffraction. Diffraction is the change in the wave length when it passes through a barrier. Light waves have to do with rainbows. The sun is known to be white light, the special feature of white light is that it contains all colors meaning white light is an additive color mixture. To determine the visible spectra of light sources we can solve for different wavelengths - Y1=(lambda x D)/s. Different wavelengths exhibit different diffraction angles and each color has a different wavelength therefore each color diffracts at a different place, this allows us to see each color in white light since the diffraction grating has the capability to separate the light. Hence one can create rainbows using a grating and a white light source. So the water left in the air after it rains acts as the grating mechanism and the white light source is the sun.
But to why rainbows create joy I cannot answer, it may be due to the idea of hope or magic or the idea there is a leprechaun at the end with a pot of gold at the end just for you if you can find it. (sorry to ruin your hopes and dreams if you’re a leprechaun hunter or a gold digger but there is no such thing as that leprechaun and a pot of gold at the end of the rainbow since rainbows actually make a complete circle,. So note to you, stop trying to find the end of the rainbow because it doesn’t exist. You may have better luck looking in the parries of Ireland for those leprechauns and for the gold, maybe try a pirates map, I sincerely wish you the best of luck.)