I am following a graduate mathematics course. While in class, I noticed that my classmates notes almost sliding off her inclined desk, and I whispered to her that gravity was a bitch. I think I saw the lecturer, a woman, react to this but I am not sure. I am now worried that our lecturer thinks I called her a bitch. I have the utmost respect for her and I'd hate for her to think otherwise. How can this be fixed?
I think the best course of action is to explain what happened and apologize to the instructor. After that it is up to her if she is willing to accept your explanation and apology. Natural you should avoid repeating this attempt at joking in a classroom setting and save it for more informal environments.