You have several methods to write and insert formulas directly in a document. It's possible as well to create stand-alone formulas, which you can save and insert afterwards in a Writer, Calc or Impress document.