math-elements

Getting Started

Installation

Bower

$ bower install --save math-elements

Usage

<!doctype html>
<html>
  <head>
    <script src="bower_components/platform/platform.js"></script>
    <link rel="import" href="bower_components/math-elements/math.html">
  </head>
  <body>
    <math-elements></math-elements>
  </body>
</html>

Reference

name polymer-element attributes default values
main container math-elements
element math-el
italic math-i
superscript math-super
subscript math-sub
superscript-subscript math-super-sub
fraction math-frac
brackets math-brack l, r l: '(', r: ')'
limit math-lim v, p v: 'x', p: 'a'
derivative math-deriv v v: 'x'
partial derivative math-par-deriv v v: 'x'
integral math-inte v v: 'x'
definite integral math-def-inte ll, ul, v ll: 'a', ul: 'b', v: 'x'
sum math-sum ll, ul, i ll: 'm', ul: 'n', i: 'i'
product math-prod ll, ul, i ll: 'm', ul: 'n', i: 'i'
matrix math-matrix
matrix row math-row
  • l = left
  • r = right
  • v = variable
  • p = point
  • ll = lower limit
  • ul = upper limit
  • i = index
<math-elements></math-elements>
n/a
<math-el></math-el>
n/a
<math-i></math-i>
e
<math-super></math-super>
xsuper
<math-sub></math-sub>
xsub
<math-super-sub>
  <math-super></math-super>
  <math-sub></math-sub>
</math-super-sub>
x super sub
<math-lim></math-lim>
<math-frac>
  <math-el></math-el>
  <math-el></math-el>
</math-frac>
a + b c
<math-brack></math-brack>
a b
<math-deriv></math-deriv>
<math-par-deriv></math-par-deriv>
<math-inte></math-inte>
<math-def-inte></math-def-inte>
<math-sum></math-sum>
<math-prod></math-prod>
<math-brack l="[" r="]">
  <math-matrix>
    <math-row>
      <math-el></math-el><math-el></math-el><math-el></math-el>
    </math-row>
    <math-row>
      <math-el></math-el><math-el></math-el><math-el></math-el>
    </math-row>
    <math-row>
      <math-el></math-el><math-el></math-el><math-el></math-el>
    </math-row>
  </math-matrix>
</math-brack>
a1 1a1 2a1 3 a2 1a2 2a2 3 a3 1a3 2a3 3

Examples

<math-elements>
  <math-lim v="h" p="0">
    <math-frac>
      <math-el>
        ƒ(<math-i>a</math-i> + <math-i>h</math-i>) − ƒ(<math-i>a</math-i>)
      </math-el>
      <math-el>
        <math-i>h</math-i>
      </math-el>
    </math-frac>
  </math-lim>
</math-elements>
ƒ(a + h) − ƒ(a) h
<math-elements>
  <math-deriv>
    <math-brack l="[" r="]">
      <math-frac>
        <math-el>
          ƒ(<math-i>x</math-i>)
        </math-el>
        <math-el>
          <math-i>g</math-i>(<math-i>x</math-i>)
        </math-el>
      </math-frac>
    </math-brack>
  </math-deriv>
  =
  <math-frac>
    <math-el>
      <math-i>g</math-i>(<math-i>x</math-i>)
      <math-deriv>[ƒ(<math-i>x</math-i>)]</math-deriv>
      −
      ƒ(<math-i>x</math-i>)
      <math-deriv>[<math-i>g</math-i>(<math-i>x</math-i>)]</math-deriv>
    </math-el>
    <math-el>
      [<math-i>g</math-i>(<math-i>x</math-i>)]<math-super>2</math-super>
    </math-el>
  </math-frac>
</math-elements>
ƒ(x) g(x) = g(x) [ƒ(x)] − ƒ(x) [g(x)] [g(x)]2
<math-elements>
  <math-def-inte>
    ƒ(<math-i>x</math-i>)
  </math-def-inte>
  =
  <math-lim v="n" p="∞">
    <math-sum ll="1" ul="n">
      ƒ(<math-i>x</math-i>
      <math-super-sub>
        <math-super>*</math-super>
        <math-sub><math-i>i</math-i></math-sub>
      </math-super-sub>)
      Δ<math-i>x</math-i>
    </math-sum>
  </math-lim>
</math-elements>
ƒ(x) = ƒ(x * i ) Δx
<math-elements>
  <math-sum ll="0" ul="∞" i="n">
    <math-frac>
      <math-el>
        ƒ<math-super><math-i>n</math-i></math-super>(<math-i>a</math-i>)
      </math-el>
      <math-el>
        <math-i>n</math-i>!
      </math-el>
    </math-frac>
    (<math-i>x</math-i> − <math-i>a</math-i>)<math-super><math-i>n</math-i></math-super>
  </math-sum>
</math-elements>
ƒn(a) n! (xa)n
<math-elements>
  <math-inte v="t">
    <math-frac>
      <math-el>
        5 <math-i>e</math-i><math-super>tan
        <math-super>− 1</math-super>(<math-i>t</math-i>)</math-super>
      </math-el>
      <math-el>
        4 (<math-i>t</math-i><math-super>2</math-super> + 1)
      </math-el>
    </math-frac>
  </math-inte>
</math-elements>
5 etan − 1(t) 4 (t2 + 1)