Am I allowed to write an essay about a scientific theory without violating the copyright?
Yes.

Scientific principles are never subject to copyright—you cannot copyright a scientific idea, theory, equation, or concept. 

That said, you do have to worry about copyright if you extensively quote from copyrighted primary or secondary resources as part of your text. If you are not directly using their language, then you need only cite the works, and no royalty or copyright issues should arise.

(Note that in the particular case of the special theory of relativity, it is more than 95 years old (as it was announced in 1905), and thus is no longer under US copyright protection in any event, so you could in principle reuse or even reprint the entire text of his article.)