I stumbled upon this problem recently, and the way I found was to edit the xml from the paragraph, since it appears that the DocX doesn't have this function.
To do so, I created a .docx file in Word with the elements I wanted, changed the extension to .zip, and read the xml from the word\document.xml
file. So, for a square root, for example, the code in C# is the following:
DocX doc = DocX.Create("testeDocument.docx");
Paragraph eqParagraph = doc.InsertEquation("");
XElement xml = eqParagraph.Xml;
XNamespace mathNamespace = "http://schemas.openxmlformats.org/officeDocument/2006/math";
XElement omath = xml.Descendants(mathNamespace + "oMath").First();
omath.Elements().Remove();
XElement sqrt= new XElement(mathNamespace + "rad");
XElement deg = new XElement(mathNamespace + "deg");
XElement radProp = new XElement(mathNamespace + "radPr");
XElement degHide = new XElement(mathNamespace + "degHide");
degHide.Add(new XAttribute(mathNamespace + "val", 1));
radProp.Add(degHide);
sqrt.Add(radProp);
sqrt.Add(deg);
XElement rad = new XElement(mathNamespace + "e");
rad.Add(new XElement(mathNamespace + "r", new XElement(mathNamespace + "t", "this goes inside the sqrt")));
sqrt.Add(rad);
omath.Add(sqrt);
doc.Save();