This site is supported by donations to The OEIS Foundation.

# Template:Math/tests

This template is under construction.

Please do not use this unfinished and/or still unreliable template.

This is a testing template for the {{math}} OEIS Wiki utility template. (This is a work in progress...!)

## Tests

### Polynomial

The code

{{indent}}{{math|''x''{{^|3}} {{op|-}} ''x''{{^|2}} {{op|+}} 1|&&}}, <!--
-->{{math|''x''{{^|3|tex}} {{op|-|tex}} ''x''{{^|2|tex}} {{op|+|tex}} 1|$$}} yields the display style HTML+CSS, display style LaTeX  x 3 − x 2 + 1 ,${\displaystyle {\begin{array}{l}\displaystyle {x^{3}-x^{2}+1}\end{array}}}$ while the code : before {{math|''x''{{^|3}} {{op|-}} ''x''{{^|2}} {{op|+}} 1|&}}, <!-- -->{{math|''x''{{^|3|tex}} {{op|-|tex}} ''x''{{^|2|tex}} {{op|+|tex}} 1|}} after yields the text style HTML+CSS, text style LaTeX before  x 3 − x 2 + 1 ,${\displaystyle \textstyle {x^{3}{\,}-{\,}x^{2}+1}}$ after ### Absolute value of polynomial The code {{indent}}{{math|{{abs| ''x''{{^|3}} {{op|-}} ''x''{{^|2}} {{op|+}} 1 |HTM}}|&&}}, <!-- -->{{math|{{abs| ''x''{{^|3|tex}} {{op|-|tex}} ''x''{{^|2|tex}} {{op|+|tex}} 1|TEX}}|$$}}

yields the display style HTML+CSS, display style LaTeX

 x 3 − x 2 + 1
,${\displaystyle {\begin{array}{l}\displaystyle {\left\vert x^{3}-x^{2}+1\right\vert }\end{array}}}$

while the code

: before {{math|{{abs| ''x''{{^|3}} {{op|-}} ''x''{{^|2}} {{op|+}} 1 |HTM}}|&}}, <!--
-->{{math|''D'' {{=}} ''q''{{^|2|tex}}{{op|+}}''p''{{^|3|tex}} {{rel|>|tex}} 0|$}}. These are given by Cardan{{'}}s formula as{{nl}} {{indent}}{{math|<!-- -->''y''{{sub|1|tex}} {{=}} ''u''{{op|+}}''v'',{{sp|quad|tex}}<!-- -->''y''{{sub|2|tex}} {{=}} {{op|-}}{{frac|''u''{{op|+}}''v''|2|TEX}}{{op|+}}''i''{{sp|3|tex}}{{frac|{{sqrt|3|tex}}|2|TEX}}{{sp|3|tex}}(''u'' {{op|-}} ''v''),{{sp|quad|tex}}<!-- -->''y''{{sub|3|tex}} {{=}} {{op|-}}{{frac|''u''{{op|+}}''v''|2|TEX}}{{op|-}}''i''{{sp|3|tex}}{{frac|{{sqrt|3|tex}}|2|TEX}}{{sp|3|tex}}(''u'' {{op|-}} ''v''),<!-- -->|$$}} where {{indent}}{{math|<!-- -->''u'' {{=}} {{root|{{op|-}}''q''{{op|+}}{{sqrt|''q''{{^|2|tex}}{{op|+}}''p''{{^|3|tex}}|tex}}|3|TEX}},{{sp|quad|tex}}<!-- -->''v'' {{=}} {{root|{{op|-}}''q''{{op|-}}{{sqrt|''q''{{^|2|tex}}{{op|+}}''p''{{^|3|tex}}|tex}}|3|TEX}}.<!-- --> |$$}} yields the LaTeX: The reduced cubic equation${\displaystyle \textstyle {y^{3}+3py+2q=0}}$ has one real and two complex solutions when${\displaystyle \textstyle {D=q^{2}+p^{3}{>}0}}$. These are given by Cardan’s formula as ${\displaystyle {\begin{array}{l}\displaystyle {y_{1}{\!\,\!}=u+v,{\quad }y_{2}{\!\,\!}=-{\frac {u+v}{2}}+i{\,}{\frac {\sqrt {3}}{2}}{\,}(u-v),{\quad }y_{3}{\!\,\!}=-{\frac {u+v}{2}}-i{\,}{\frac {\sqrt {3}}{2}}{\,}(u-v),}\end{array}}}$ where ${\displaystyle {\begin{array}{l}\displaystyle {u={\sqrt[{3}]{-q+{\sqrt {q^{2}+p^{3}}}}},{\quad }v={\sqrt[{3}]{-q-{\sqrt {q^{2}+p^{3}}}}}.}\end{array}}}$ ### Curvature of plane curve The code The curvature at any point of the plane curve {{math|''C''|&}} given by {{math|''r''{{sp|1}}(''t'') {{=}} (''x''{{sp|1}}(''t''),{{sp|3}}''y''{{sp|1}}(''t''))|&}} is{{nl}} {{indent}}{{math| ''{{Greek|kappa}}'' {{=}} {{frac | ''x''{{op|1st}}{{sp|1}}''y''{{op|2nd}} {{op|-}} ''y''{{op|1st}}{{sp|1}}''x''{{op|2nd}} | {{big|(}}({{sp|1}}''x''{{op|1st}}){{^|2}} {{op|+}} ({{sp|2}}''y''{{op|1st}}){{^|2}}{{sp|1}}{{big|)}}{{^|3/2}} |HTM}}{{sp|1}}. |&&}} yields the HTML+CSS: The curvature at any point of the plane curve  C given by  r (t) = (x (t), y (t)) is κ =  x y − y x (( x) 2 + ( y) 2 ) 3/2 . The code The curvature at any point of the plane curve {{math|''C''|$}} given by {{math|''r''(''t'') {{=}} (''x''(''t''),{{sp|3|tex}}''y''(''t''))|\$}} is

{{indent}}{{math|

''{{Greek|kappa|tex}}'' {{=}} {{frac
| ''x''{{op|1st|tex}}''y''{{op|2nd|tex}} {{op|-|tex}} ''y''{{op|1st|tex}}''x''{{op|2nd|tex}}
| {{big|(|tex}}(''x''{{op|1st|tex}}){{^|2|tex}} {{op|+|tex}} (''y''{{op|1st|tex}}){{^|2|tex}}{{big|)|tex}}{{^|3/2|tex}}
|TEX}}.

|$$}} yields the LaTeX: The curvature at any point of the plane curve${\displaystyle \textstyle {C}}$ given by${\displaystyle \textstyle {r(t)=(x(t),{\,}y(t))}}$ is ${\displaystyle {\begin{array}{l}\displaystyle {\kappa ={\frac {xy-yx}{{\big (}(x)^{2}+(y)^{2}{\big )}^{3/2}}}.}\end{array}}}$ ### Catalan numbers The code {{indent}}{{math|<!-- -->''C''{{sub|''n''}} {{=}} {{frac|1|''n'' + 1|HTM}} {{binom|2''n''|''n''|HTM}} {{=}} {{frac|(2''n'')!|(''n'' + 1)!{{sp|3}}''n''!|HTM}} {{=}} <!-- -->{{prod|''k''{{=}}2|''n''|{{frac|''n'' + ''k''|''k''|HTM}}|HTM}},{{sp|quad}}''n'' {{rel|ge}} 0.<!-- -->|&&}} yields the display style HTML+CSS Cn =  1 n + 1 (  2n n ) =  (2n)! (n + 1)! n! =  n ∏ k = 2  n + k k , n ≥ 0. The code {{indent}}{{math|<!-- -->''C''{{sub|''n''|TEX}} {{=}} {{frac|1|''n'' + 1|TEX}} {{binom|2''n''|''n''|TEX}} {{=}} {{frac|(2''n'')!|(''n'' + 1)!{{sp|3|tex}}''n''!|TEX}} {{=}} <!-- -->{{prod|''k''{{=}}2|''n''|{{frac|''n'' + ''k''|''k''|TEX}}|TEX}},{{sp|quad|TEX}}''n'' {{rel|ge|TEX}} 0.<!-- -->|$$}}

yields the display style LaTeX

${\displaystyle {\begin{array}{l}\displaystyle {C_{n}{\!\,\!}={\frac {1}{n+1}}{\binom {2n}{n}}\!={\frac {(2n)!}{(n+1)!{\,}n!}}=\prod _{k=2}^{n}{\frac {n+k}{k}},{\quad }n\geq 0.}\end{array}}}$

### Summations and integrals

#### Mellin–Barnes integral[4]

Cf. Mellin–Barnes integralDLMF, NIST Project.

The code

{{indent}}{{math|
''B''{{sub|''n''}}{{sp|1}}(''x'') {{=}} {{frac|1|2{{Gr|pi}}{{sp|1}}''i''}}{{sp|6}}<!--
-->{{int|{{op|-}}''c''{{op|-}}''i''{{sp|1}}infty|{{op|-}}''c''{{op|+}}''i''{{sp|1}}infty
|(''x'' {{op|+}} ''t''){{^|''n''}} {{(|{{frac|{{Gr|pi}}|sin{{sp|1}}({{Gr|pi}}{{sp|1}}''t''{{sp|1}})}}|)|Big}}{{^|{{^|2|100%}}}} {{d|''t''}}|HTM}}.
|&&}}

yields the display style HTML+CSS

Bn (x) =
 1 2π i
 − c + i ∞ − c − i ∞
(x + t)n
 ⎛ ⎝

 π sin (π t )

 ⎞ ⎠
2 dt.

The code

{{indent}}{{math|
''B''{{sub|''n''|tex}}(''x'') {{=}} {{frac|1|2''{{Gr|pi|tex}}{{sp|1|tex}}i''|tex}} <!--
-->{{int|{{op|-}}''c''{{op|-}}''i''{{sp|1|tex}}infty|{{op|-}}''c''{{op|+}}''i''{{sp|1|tex}}infty
|(''x'' {{op|+}} ''t''){{^|''n''|tex}} {{(|{{frac|{{Gr|pi|tex}}|\sin{{sp|1|tex}}({{Gr|pi|tex}}{{sp|1|tex}}''t'')|tex}}|)|Big|tex}}{{^|2|tex}} <!--
-->{{d|''t''|tex}}|TEX}}.
|$$}} yields the display style LaTeX ${\displaystyle {\begin{array}{l}\displaystyle {B_{n}{\!\,\!}(x)={\frac {1}{2\pi {\;\;\!\!\!}i}}\int _{-c-i{\;\;\!\!\!}\infty }^{-c+i{\;\;\!\!\!}\infty }\;{(x+t)^{n}{\Big (}{\frac {\pi }{\sin {\;\;\!\!\!}(\pi {\;\;\!\!\!}t)}}{\Big )}^{2}d^{}t}.}\end{array}}}$ #### Elliptic integrals Cf. Elliptic integralsDLMF, NIST Project. The code {{indent}}{{math| ''R''{{sub|{{sp|1}}{{op|-}}''a''}}{{sp|1}}({{vec|b|b}}; {{vec|z|b}}) {{=}} {{frac | 4{{sp|1}}{{Gr|Gamma}}(''b''{{sub|1}} {{op|+}} ''b''{{sub|2}} {{op|+}} ''b''{{sub|3}}) | {{Gr|Gamma}}(''b''{{sub|1}}){{sp|2}}{{Gr|Gamma}}(''b''{{sub|2}}){{sp|2}}{{Gr|Gamma}}(''b''{{sub|3}}) }}{{sp}} {{int|0|{{Gr|pi}}{{op|/}}2|HTM}}{{int|0|{{Gr|pi}}{{op|/}}2|HTM}}{{sp|6}}<!-- -->{{(|{{sum|''i''{{=}}1|3|''z''{{sub|''j''}}{{sp|2}}''l''{{subsup|{{sp|-2}}''j''|2}}|HTM}}|)|Bigg}}{{^|{{^|{{^|{{op|-}}''a''|100%}}|100%}}}}{{sp|6}}<!-- -->{{(|{{prod|''j''{{=}}1|3| ''l''{{subsup|''j''|2''b''{{sub|''j''}}{{sp|1}}{{op|-}}1}}|HTM}}|)|Bigg}}{{sp|6}}<!-- -->{{op|sin}}{{sp|1}}''{{Gr|theta}}''{{sp|3}}{{d|''{{Gr|theta}}''}}{{sp|3}}{{d|''{{Gr|phi}}''}},<!-- -->{{sp|quad}}''b''{{sub|''j''}} {{rel|>}} 0, {{sym|Re}}{{sp|1}}''z''{{sub|''j''}} {{rel|>}} 0. |&&}} yields the display style HTML+CSS (The exponent  − a needs to be raised higher more conveniently!)  Error: String exceeds 10,000 character limit. The code (broken in two parts to avoid the pesky: “Error: String exceeds 10,000 character limit.”) {{indent}}{{math| ''R''{{sub|{{sp|1}}{{op|-}}''a''}}{{sp|1}}({{vec|b|b}}; {{vec|z|b}}) {{=}} {{frac | 4{{sp|1}}{{Gr|Gamma}}(''b''{{sub|1}} {{op|+}} ''b''{{sub|2}} {{op|+}} ''b''{{sub|3}}) | {{Gr|Gamma}}(''b''{{sub|1}}){{sp|2}}{{Gr|Gamma}}(''b''{{sub|2}}){{sp|2}}{{Gr|Gamma}}(''b''{{sub|3}}) }}|&&}}{{sp}}{{math| {{int|0|{{Gr|pi}}{{op|/}}2|HTM}}{{int|0|{{Gr|pi}}{{op|/}}2|HTM}}{{sp|6}}<!-- -->{{(|{{sum|''i''{{=}}1|3|''z''{{sub|''j''}}{{sp|2}}''l''{{subsup|{{sp|-2}}''j''|2}}|HTM}}|)|Bigg}}{{^|{{^|{{^|{{op|-}}''a''|100%}}|100%}}}}{{sp|6}}<!-- -->{{(|{{prod|''j''{{=}}1|3| ''l''{{subsup|''j''|2''b''{{sub|''j''}}{{sp|1}}{{op|-}}1}}|HTM}}|)|Bigg}}{{sp|6}}<!-- -->{{op|sin}}{{sp|1}}''{{Gr|theta}}''{{sp|3}}{{d|''{{Gr|theta}}''}}{{sp|3}}{{d|''{{Gr|phi}}''}},<!-- -->{{sp|quad}}''b''{{sub|''j''}} {{rel|>}} 0, {{sym|Re}}{{sp|1}}''z''{{sub|''j''}} {{rel|>}} 0. |&&}} yields the display style HTML+CSS (The exponent  − a needs to be raised higher more conveniently!) R − a (b; z) =  4 Γ(b1 + b2 + b3) Γ(b1) Γ(b2) Γ(b3)  π / 2 0  π / 2 0  ⎛ ⎜ ⎝  3 ∑ i = 1 zj l2j  ⎞ ⎟ ⎠ − a  ⎛ ⎜ ⎝  3 ∏ j = 1 l2bj −1j  ⎞ ⎟ ⎠ sin θdθdϕ, bj > 0, ℜ zj > 0. The code {{indent}}{{math| ''R''{{sub|{{op|-}}''a''|tex}}{{sp|1|tex}}({{vec|b|b|tex}}; {{vec|z|b|tex}}) {{=}} <!-- -->{{frac |4{{sp|1|tex}}{{Gr|Gamma|tex}}(''b''{{sub|1|tex}}{{op|+}}''b''{{sub|2|tex}}{{op|+}}''b''{{sub|3|tex}}) |{{Gr|Gamma|tex}}(''b''{{sub|1|tex}}){{sp|2|tex}}{{Gr|Gamma|tex}}(''b''{{sub|2|tex}}){{sp|2|tex}}{{Gr|Gamma|tex}}(''b''{{sub|3|tex}}) |tex}}<!-- -->{{sp|3|tex}}{{int|0|{{Gr|pi|tex}}{{op|/|tex}}2|TEX}}{{int|0|{{Gr|pi|tex}}{{op|/|tex}}2|TEX}}<!-- --> {{(|{{sum|''i''{{=}}1|3| ''z''{{sub|''j''|tex}}{{sp|1|tex}}''l''{{subsup|''j''|2|tex}}|TEX}}|)|Bigg|tex}}{{^|{{op|-}}''a''|tex}} <!-- --> {{(|{{prod|''j''{{=}}1|3| ''l''{{subsup|''j''|2''b''{{sub|''j''|tex}}{{op|-}}1|tex}}|TEX}}|)|Bigg|tex}}<!-- -->{{sp|3|tex}}{{op|sin|tex}}''{{Gr|theta|tex}}''{{sp|3|tex}}{{d|''{{Gr|theta|tex}}''|tex}}{{sp|3|tex}}{{d|''{{Gr|phi|tex}}''|tex}},<!-- -->{{sp|quad|tex}}''b''{{sub|''j''|tex}} {{rel|>|tex}} 0, {{sym|Re|tex}}{{sp|1|tex}}''z''{{sub|''j''|tex}} {{rel|>|tex}} 0. |$$}}

yields the display style LaTeX

${\displaystyle {\begin{array}{l}\displaystyle {R_{-a}{\!\,\!}{\;\;\!\!\!}(\mathbf {b} ;\mathbf {z} )={\frac {4{\;\;\!\!\!}\Gamma (b_{1}{\!\,\!}+b_{2}{\!\,\!}+b_{3}{\!\,\!})}{\Gamma (b_{1}{\!\,\!}){\;\!}\Gamma (b_{2}{\!\,\!}){\;\!}\Gamma (b_{3}{\!\,\!})}}{\,}\int _{0}^{\pi /2}\;\int _{0}^{\pi /2}\;{\Bigg (}\sum _{i=1}^{3}z_{j}{\!\,\!}{\;\;\!\!\!}l_{j}^{2}{\Bigg )}^{-a}{\Bigg (}\prod _{j=1}^{3}l_{j}^{2b_{j}{\!\,\!}-1}{\Bigg )}{\,}{\sin }\,\theta {\,}d^{}\theta {\,}d^{}\phi ,{\quad }b_{j}{\!\,\!}{>}0,{\Re }{\;\;\!\!\!}z_{j}{\!\,\!}{>}0.}\end{array}}}$

## γ/π

The code (see A301813 for decimal expansion of
 γ/π
)
{{indent}}{{math|{{frac|{{Gr|gamma}}|{{Gr|pi}}|HTM}} {{=}} {{int|{{op|-}}infty|{{op|+}}infty|HTM}} {{op|-}} log {{root|''z''{{^|2}} {{op|+}} {{tfrac|1|4}}|4|HTM}} {{op|sech}}{{sp|1}}({{Gr|pi}}{{sp|1}}''z''){{^|2}} {{d|''z''}}
|tex = \frac{\gamma}{\pi} = \int_{-\infty}^{+\infty} - \log \sqrt[4]{ z^2 + \tfrac{1}{4} } {{op|sech|tex}}(\pi z)^2 dz
|$$}} yields the display style HTML+CSS (with the && option)  γ π =  + ∞ − ∞ − log 4 z 2 +  1 4 sech (π z) 2 dz or yields the display style LaTeX (with the$$ option):

${\displaystyle {\begin{array}{l}\displaystyle {{\frac {\gamma }{\pi }}=\int _{-\infty }^{+\infty }-\log {\sqrt[{4}]{z^{2}+{\tfrac {1}{4}}}}\operatorname {sech} \,(\pi z)^{2}dz}\end{array}}}$

### Delta function[5]

The code

{{indent}}{{math|''{{Gr|delta}}''{{sp|1}}(''x'') {{=}} <!--
-->{{lim|''n''->infty|HTM}} {{frac|1|2{{Gr|pi}}|HTM}} {{frac|{{fn|sin}} {{(|{{(|''n'' + {{tfrac|1|2}}|)|big}} ''x''|)|big [ ]}}|{{fn|sin}} {{(|{{tfrac|1|2}} ''x''|)|big}}|HTM}}.
| tex = \delta(x) = \lim_{n \to \infty} \frac{1}{2\pi} \frac{\sin [(n + \frac{1}{2}) x]}{\sin (\frac{1}{2} x)}.
|&&}}

yields the display style HTML+CSS

δ (x) =
 1 2π
sin
 ⎡ ⎣
 ⎛ ⎝
n +
 1 2

 ⎞ ⎠
x
 ⎤ ⎦
sin
 ⎛ ⎝

 1 2
x
 ⎞ ⎠
.

The code

{{indent}}{{math|''{{Gr|delta|tex}}''(''x'') {{=}} {{lim|''n''->infty|TEX}} {{frac|1|2{{Gr|pi|tex}}|tex}} {{frac|{{fn|sin|tex}} [(''n'' + {{tfrac|1|2|tex}}) ''x'']|{{fn|sin|tex}} ({{tfrac|1|2|tex}} ''x'')|tex}}.|$$}} yields the display style LaTeX ${\displaystyle {\begin{array}{l}\displaystyle {\delta (x)=\lim _{n{\to }\infty }{\frac {1}{2\pi }}{\frac {{\sin }\,[(n+{\tfrac {1}{2}})x]}{{\sin }\,({\tfrac {1}{2}}x)}}.}\end{array}}}$ The code : $\delta(x) = \lim_{n \to \infty} \frac{1}{2\pi} \frac{\sin [(n + \frac{1}{2}) x]}{\sin (\frac{1}{2} x)}.$ yields the display style LaTeX ${\displaystyle \delta (x)=\lim _{n\to \infty }{\frac {1}{2\pi }}{\frac {\sin[(n+{\frac {1}{2}})x]}{\sin({\frac {1}{2}}x)}}.}$ ### BPP formula The code : {{math |{{Gr|pi}} {{=}} {{sum|''k''{{=}}0|infty|HTM}} {{sqbrack|Big l}} {{frac|1|16{{^|''k''}}|HTM}} <!-- -->{{paren|Big l}}{{frac|4|8''k'' + 1|HTM}} {{op|-}} {{frac|2|8''k'' + 4|HTM}} {{op|-}} {{frac|1|8''k'' + 5|HTM}} {{op|-}} {{frac|1|8''k'' + 6|HTM}}{{paren|Big r}} {{sqbrack|Big r}}, |tex = \pi = \sum_{k{{=}}0}^{\infty} \left[ \frac{1}{16^k} \left( \frac{4}{8k + 1} - \frac{2}{8k + 4} - \frac{1}{8k + 5} - \frac{1}{8k + 6} \right) \right], |&&}} yields the display style HTML+CSS (the {{(|...|)}} template needs more work!) π =  ∞ ∑ k = 0  ⎡ ⎣  1 16 k  ⎛ ⎝  4 8k + 1  2 8k + 4  1 8k + 5  1 8k + 6  ⎞ ⎠  ⎤ ⎦ , and with the$$ option yields the display style LaTeX

${\displaystyle {\begin{array}{l}\displaystyle {\pi =\sum _{k=0}^{\infty }\left[{\frac {1}{16^{k}}}\left({\frac {4}{8k+1}}-{\frac {2}{8k+4}}-{\frac {1}{8k+5}}-{\frac {1}{8k+6}}\right)\right],}\end{array}}}$

## Notes

1. Weisstein, Eric W., Cubic Formula, from MathWorld—A Wolfram Web Resource.
2. Weisstein, Eric W., Mellin-Barnes Integral, from MathWorld—A Wolfram Web Resource.
3. Weisstein, Eric W., Delta Function, from MathWorld—A Wolfram Web Resource.