Wiris

Documentation / MathType

  • Demos
  • Visit our website
  • Downloads
  • Contact us
  • MathType

    • WirisQuizzes

      • Nubric

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • MathType
                      • Technical documentation
                      • MathType for HTML editors
                      • Reference

                      Expression evaluation

                      Reading time: 1min

                      Reference describing the MathType expression evaluation engine and its capabilities.

                      Summary

                      MathType includes a mathematical expression evaluation engine that computes the numerical value of expressions represented as MathML. The evaluation engine is intended for numerical calculations. It is not a Computer Algebra System (CAS) and does not perform symbolic manipulation.

                      Expression evaluation relies on Content MathML. When a Presentation MathML expression is evaluated, MathType first converts it into Content MathML before traversing the resulting semantic expression tree.

                      Supported behaviour

                      Feature Supported Notes
                      Numerical evaluation ✓ Evaluates well-formed mathematical expressions.
                      Variable substitution ✓ Variable values can be supplied before evaluation.
                      Syntax validation ✓ Invalid expressions can be detected before evaluation.
                      Content MathML conversion ✓ Presentation MathML is converted internally before evaluation.
                      Symbolic algebra ✗ Not supported. Use a CAS for symbolic manipulation.

                      Evaluation workflow

                      Expression evaluation follows these steps:

                      1. The expression is received as MathML.
                      2. If necessary, Presentation MathML is converted to Content MathML.
                      3. The resulting Content MathML tree is validated.
                      4. Variables are substituted.
                      5. The expression is evaluated.
                      6. The numerical result is returned.

                      Syntax checking

                      The evaluation engine operates only on expressions that are valid according to MathType's internal grammar. Syntax checking helps identify expressions that cannot be evaluated. For example:

                      • ✅ 3 + 5
                      • ✅ x + 2
                      • ❌ 3 +

                      Syntax checking can be enabled using the editor parameters:

                      editor.setParams({
                        toolbar: "evaluate",
                        checkSyntax: "true"
                      });

                      The evaluate toolbar is specifically designed for authoring expressions intended for numerical evaluation.

                      Variables

                      Variables can be assigned values before evaluation. For example:

                      Variable Value
                      x 8.5
                      y 2

                      The evaluation engine substitutes these values before performing the calculation.

                      Limitations

                      The evaluation engine performs numerical evaluation only. It does not support:

                      • Symbolic simplification.
                      • Equation solving.
                      • Symbolic differentiation.
                      • Symbolic integration.
                      • Algebraic transformations.

                      If these capabilities are required, use a Computer Algebra System (CAS).

                      Relationship with Content MathML

                      Expression evaluation depends on Content MathML. Presentation MathML expressions are converted into Content MathML before evaluation.

                      See Content MathML for more information about the conversion process.

                       

                      Notes

                      • Only well-formed mathematical expressions can be evaluated.
                      • Invalid expressions result in evaluation errors.
                      • Decimal numbers always use the period (.) as the decimal separator.
                      • Variable names are case-sensitive.

                      Related articles

                      • Content MathML.
                      • MathML coverage reference.
                      • API services.

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • Expression
                      • Not null
                      • Not belongs

                      Expression evaluation

                      Summary Supported behaviour Evaluation workflow Syntax checking Variables Limitations Relationship with Content MathML Notes Related articles

                      Empowering STEM education

                      MathType

                      • Office Tools
                      • LMS
                      • XML
                      • HTML

                      WirisQuizzes

                      Nubric

                      Integrations

                      Solutions

                      • Education
                      • Publishing houses – platforms and interactive
                      • Publishing houses – Print and digital
                      • Technical writers

                      Pricing

                      Downloads

                      Blog

                      • Success stories

                      About us

                      • Careers
                      • Partnership

                      Contact Us

                      Contact Sales

                      European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Cookie Settings

                      © Wiris 2026

                      Expand