There are two ways (afaik) to parse traditional math string to an expression:
toExpr = ToExpression[#, TraditionalForm] &
interpreter = Interpreter["MathExpression"]
The former is faster but less capable.
I would like to know what are the differences between those approaches because I would like to avoid Interpreter unless I have to use it.
For a start:
toExpr@"sin^(-1)(x)"
interpreter@"sin^(-1)(x)"
x/sin
ArcSin[x]
toExpr["x(x)"]
interpreter["x(x)"]
x[x]
x^2
I would like to know other similar differences.
1/(a*x),(1/a)*x, or1/axdepending on the mood of the author and the field of study (math, physics, econ, etc.). $sin^{-1}x$ meansArcSin[x]or1/Sin[x]depending on relative humidity. As you show below, $a=b$ meansa==bora=bdepending on context. There's lots of experience, intuition, and fault-tolerance going into parsing real math written by real people. – Roman Apr 17 '21 at 05:36"sin t^2"/"sin t^(2)"/"sin t^(-1)","f^(-1)(x)","sin^(-2)(x)"– Michael E2 Apr 17 '21 at 17:23