XSL-FO - WordML - XSLT

# Calculus

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

The following content elements represent various operators or functions used in calculus: int, diff, partialdiff, grad, divergence, curl, and laplacian. The following sections provide examples of how these elements are used.

## Integrals

Integrals are represented using the int element. The variable of integration is specified using the qualifier element bvar. Here is an example:

``````<apply>
<int/>
<bvar><ci>x</ci></bvar>
<ci>x</ci>
</apply>
``````

For definite integrals, the upper and lower limits of integration can be represented using the qualifier elements lowlimit and uplimit, as shown here:

``````<apply>
<int/>
<bvar><ci>x</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><pi/></uplimit>
<apply><sin/><ci>x</ci></apply>
</apply>
``````

The limits of integration can also be specified using the interval element, while integration over a general domain can be specified using the condition element. Examples of using the interval and condition elements to represent the range of integration are provided in the discussion of these elements under Constructor elements.

## Derivatives

The diff element is used to represent derivatives of functions of a single variable, as shown below:

``````<diff>
<ci>f</ci>
</diff>
``````

The qualifier element bvar is used to specify the variable of integration. The bvar element can include a degree element to specify the degree of differentiation, as shown below:

``````<apply>
<diff/>
<bvar><ci>x</ci></bvar>
<degree><cn>2</cn></degree>
<apply>
<ci type="fn">f</ci>
<ci>x</ci>
</apply>
</apply>
``````

## Partial derivatives

The partialdiff element is used to represent partial derivatives of multivariable functions. Here is an example:

``````<apply>
<partialdiff/>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<apply>
<ci type="fn">f</ci>
<ci>x</ci>
<ci>y</ci>
</apply>
</apply>
``````

You can specify the degree of differentiation with respect to any of the variables by including a degree element inside the bvar element that corresponds to that variable. You can also include a degree element directly as a child element of the enclosing apply element to specify the total degree of differentiation, as shown here:

``````<apply>
<partialdiff/>
<bvar>
<ci>x</ci>
<degree><ci>m</ci></degree>
</bvar>
<bvar>
<ci>y</ci>
<degree><ci>n</ci></degree>
</bvar>
<apply>
<ci type="fn">f</ci>
<ci>x</ci>
<ci>y</ci>
</apply>
</apply>
``````

## Vector calculus

The elements grad, divergence, curl, and laplacian represent the gradient, divergence, curl, and Laplacian operators of vector calculus, respectively. For example, here is one of Maxwell's equations of electrodynamics; it describes the divergence of the magnetic field:

``````<apply>
<eq/>
<apply>
<divergence/>
<ci type="vector">B</ci>
</apply>
<cn>0</cn>
</apply>
``````