Elementary functions
(Excerpt from "The MathML Handbook" by Pavi Sandhu)
Several content elements represent classical elementary functions, such as the exponential and logarithmic functions as well as the trigonometric and hyperbolic functions. Here is an example involving the exponential and natural logarithmic functions:
<apply>
<eq/>
<apply>
<ln/>
<apply>
<exp/>
<ci>x</ci>
</apply>
</apply>
<ci>x</ci>
</apply>
The log element is used to represent the natural logarithmic function. You can use the qualifier element logbase to specify the base of the logarithm. If no logbase element is present, a default value of 10 is assumed for the base, as shown here:
log2(x)
<apply>
<log/>
<logbase><cn>2</cn></logbase>
<ci>x</ci>
</apply>
Here is an example of a simple trigonometric formula:
<apply>
<eq/>
<apply>
<sin/>
<apply>
<times/>
<cn>2</cn>
<ci>x</ci>
</apply>
</apply>
<apply>
<times/>
<cn>2</cn>
<apply>
<sin/>
<ci>x</ci>
</apply>
<apply>
<cos/>
<ci>x</ci>
</apply>
</apply>
</apply>
Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.
CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America