Thin Films And Gratings: Theories Used To Optimize The High Reflectivity Of Mirrors And Gratings For X-Ray Optics