<< Chapter < Page | Chapter >> Page > |
The
eq
operator is used to write equations. It
is used in the same way as any other operator. That is, itis the first child of an apply. It takes two (or more)
children which are the two quantities that are equal to eachother. For example, "
$a$ times
$b$ plus
$a$ times
$c$ equals
$a$ times the quantity
$b$ plus
$c$ " would be written as shown.
<m:math>
<m:apply>
<m:eq/>
<m:apply>
<m:plus/>
<m:apply>
<m:times/>
<m:ci>a</m:ci>
<m:ci>b</m:ci>
</m:apply>
<m:apply>
<m:times/>
<m:ci>a</m:ci>
<m:ci>c</m:ci>
</m:apply>
</m:apply>
<m:apply>
<m:times/>
<m:ci>a</m:ci>
<m:apply>
<m:plus/>
<m:ci>b</m:ci>
<m:ci>c</m:ci>
</m:apply>
</m:apply>
</m:apply>
</m:math>
This will display as
$ab+ac=a(b+c)$ .
The operator for an integral is
int
. However,
unlike the operators and functions discussed above, it haschildren that define the independent variable that you
integrate with respect to (
bvar
) and the interval
over which the integral is taken (use either
lowlimit
and
uplimit
, or
interval
, or
condition
).
lowlimit
and
uplimit
(which go
together),
interval
, and
condition
are just three different ways of denoting the integrands.
Don't forget that the bvar,
lowlimit
,
uplimit
,
interval
, and
condition
children take token elements as well.
The following is "the integral of
$f$ of
$x$ with respect to
$x$ from 0 to
$b$ ."
<m:math>
<m:apply>
<m:int/>
<m:bvar><m:ci>x</m:ci></m:bvar>
<m:lowlimit><m:cn>0</m:cn></m:lowlimit>
<m:uplimit><m:ci>b</m:ci></m:uplimit>
<m:apply>
<m:ci type='fn'>f</m:ci>
<m:ci>x</m:ci>
</m:apply>
</m:apply>
</m:math>
This will display as
$\int_{0}^{b} f(x)\,d x$ .
The derivative operator is
diff
. The derivative
is done in much the same way as the integral. That is, youneed to define a base variable (using
bvar
). The
following is "the derivative of the function
$f$ of
$x$ , with respect to
$x$ ."
<m:math>
<m:apply>
<m:diff/>
<m:bvar>
<m:ci>x</m:ci>
</m:bvar>
<m:apply>
<m:ci type="fn">f</m:ci>
<m:ci>x</m:ci>
</m:apply>
</m:apply>
</m:math>
This will display as
$\frac{d f(x)}{d x}$ .
To apply a higher level derivative to a function, add a
degree
tag inside of the
bvar
tag.
The degree tag will contain the order of the derivative. Thefollowing shows "the second derivative of the function
$f$ of
$x$ , with respect to
$x$ ."
<m:math>
<m:apply>
<m:diff/>
<m:bvar>
<m:ci>x</m:ci>
<m:degree><m:cn>2</m:cn></m:degree>
</m:bvar>
<m:apply><m:ci type="fn">f</m:ci>
<m:ci>x</m:ci>
</m:apply>
</m:apply>
</m:math>
This will display as
$\frac{d^{2}f(x)}{dx^{2}}$ .
Vectors are created as a combination of other elements using
the
vector
tag.
<m:math>
<m:vector>
<m:apply>
<m:plus/>
<m:ci>x</m:ci>
<m:ci>y</m:ci>
</m:apply>
<m:ci>z</m:ci>
<m:cn>0</m:cn>
</m:vector>
</m:math>
This will display as
$\left(\begin{array}{c}x+y\\ z\\ 0\end{array}\right)$ .
Matrices are done in a similar manner. Each
matrix
element contains several
matrixrow
elements. Then each
matrixrow
element contains several other
elements.
<m:math>
<m:matrix>
<m:matrixrow>
<m:ci>a</m:ci>
<m:ci>b</m:ci>
<m:ci>c</m:ci>
</m:matrixrow>
<m:matrixrow>
<m:ci>d</m:ci>
<m:ci>e</m:ci>
<m:ci>f</m:ci>
</m:matrixrow>
<m:matrixrow>
<m:ci>g</m:ci>
<m:ci>h</m:ci>
<m:ci>j</m:ci>
</m:matrixrow>
</m:matrix>
</m:math>
This will display as
$\begin{pmatrix}a & b & c\\ d & e & f\\ g & h & j\\ \end{pmatrix}$ .
There are also operators to take the determinant and the transpose of a matrix as well as to select elements fromwithin the matrix.
MathML defines its own entities for many special characters used in mathematical notation. While the entity references have the advantage of being mnemonic with respect to the characters they stand for, they also entail some technical limitations, and so their use in Connexions content is deprecated. Please use the UTF-8-encoded Unicode characters themselves where possible, or, failing that, the XML Unicode character references for the characters. At some time in the future, the Connexions repository system will likely convert entity references and character references silently to the UTF-8-encoded Unicode characters they stand for. See 6.2.1 Unicode Character Data from the XML Specification for more information. The MathML specification contains a list of character entities with their corresponding Unicode code points .
There are character picker utilities available to help you select and paste UTF-8 characters into applications like Connexions. If you are running Microsoft Windows, the Windows accessory Character Map can help you. The "Lucida Sans Unicode" font seems to have a good selection of mathematical operators and special characters. Under Linux, the charmap utility and GNOME applet provide access to all Unicode characters.
There is a lot more that can be done with Content MathML. Especially if you are planning on writing a lot of ContentMathML, it is well worth your time to take a look at the MathML specification .
Notification Switch
Would you like to follow the 'Cnxml tutorial' conversation and receive update notifications?