X-rays and infrared rays are both electromagnetic. Which common property do the waves have? Both…