Skip to content Skip to navigation

Connexions

You are here: Home » Content » Content MathML Cookbook

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

Content MathML Cookbook

Module by: Connexions, Kyle Barnhart. E-mail the authors

Summary: A series of code examples explaining how to build basic algebra, calculus, trigonometry, and differential expressions using Content MathML

Content MathML, like any language, is difficult to "learn" completely. Becoming comfortable with the semantics and structure of Content MathML is a lot easier than memorizing every possible element

This MathML "cookbook" provides you with the "ingredients" (or helpful examples) to begin writing your own MathML expressions. Namespaces are not included, so please be sure to include an appropriate namespace if combining these snippets with other XML languages.

Algebra

2+2=4 2 2 4

<math>
<apply>
  <eq/>
  <apply>
    <plus/>
    <cn>2</cn>
    <cn>2</cn>
  </apply>
  <cn>4</cn>
</apply>
</math>

x2+2x+3=(x1)(x+3) x 2 2 x 3 x 1 x 3

<math>
<apply>
  <eq/>
  <apply>
    <plus/>
    <apply>
      <power/>
      <ci>x</ci>
      <cn>2</cn>
    </apply>
    <apply>
      <times/>
      <cn>2</cn>
      <ci>x</ci>
    </apply>
    <cn>3</cn>
  </apply>
  <apply>
    <times/>
    <apply>
      <minus/>
      <ci>x</ci>
      <cn>1</cn>
    </apply>
    <apply>
      <plus/>
      <ci>x</ci>
      <cn>3</cn>
    </apply>
  </apply>
</apply>
</math>

x=cba x c b a

<math>
<apply>
  <eq/>
  <ci>x</ci>
  <apply>
    <divide/>
    <apply>
      <minus/>
      <ci>c</ci>
      <ci>b</ci>
    </apply>
    <ci>a</ci>
  </apply>
</apply>
</math>

b3=log 2 a 3 b 2 a

<math>
<apply>
  <eq/>
  <apply>
    <root/>
    <degree>
      <cn>3</cn>
    </degree>
    <ci>b</ci>
  </apply>
  <apply>
    <log/>
    <logbase>
      <cn>2</cn>
    </logbase>
    <ci>a</ci>
  </apply>
</apply>
</math>

Trigonometry

sin2θ+cos2θ=1 θ 2 θ 2 1

<math>
  <apply>
    <eq/>
    <apply>
      <plus/>
      <apply>
        <power/>
        <apply>
          <sin/>
          <ci>?</ci>
        </apply>
        <cn>2</cn>
      </apply>
      <apply>
        <power/>
        <apply>
          <cos/>
          <ci>?</ci>
        </apply>
        <cn>2</cn>
      </apply>
    </apply>
    <cn>1</cn>
  </apply>
</math>

Calculus

limit   h 0 fx+hfxh h 0 f x h f x h

<math>
  <apply>
    <limit/>
    <bvar>
      <ci>h</ci>
    </bvar>
    <lowlimit>
      <cn>0</cn>
    </lowlimit>
    <apply>
      <divide/>
      <apply>
        <minus/>
        <apply>
          <ci>f</ci>
          <apply>
            <plus/>
            <ci>x</ci>
            <ci>h</ci>
          </apply>
        </apply>
        <apply>
          <ci>f</ci>
          <ci>x</ci>
        </apply>
      </apply>
      <ci>h</ci>
    </apply>
  </apply>
</math>

Fx=axftd t F x t a x f t

<math>
  <apply>
    <eq/>
    <apply>
      <ci>F</ci>
      <ci>x</ci>
    </apply>
    <apply>
      <int/>
      <bvar>
        <ci>t</ci>
      </bvar>
      <lowlimit>
        <ci>a</ci>
      </lowlimit>
      <uplimit>
        <ci>x</ci>
      </uplimit>
      <apply>
        <ci>f</ci>
        <ci>t</ci>
      </apply>
    </apply>
  </apply>
</math>

Differential Equations

dd x f y x f y

<math>
<apply>
  <diff/>
  <bvar><ci> x </ci></bvar>
  <apply><ci> f </ci>
    <ci> y </ci>
  </apply>
</apply>
</math>

2fxy x y x y f x y

<math>
  <apply>
    <partialdiff/>
    <bvar>
      <ci>x</ci>
    </bvar>
    <bvar>
      <ci>y</ci>
    </bvar>
    <apply>
      <ci type="function">f</ci>
      <ci>x</ci>
      <ci>y</ci>
    </apply>
  </apply>
</math>

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks