This site is supported by donations to The OEIS Foundation.

# Template:Integral/testcases

⧼Purge⧽ Template:Integral/testcases

Test cases for the {{integral}} template.

## Contents

### Gamma function

The code

: {{repeat|2|{{repeat|5|yadda{{nbsp}}}}{{nl}}}}before {{math|{{Gr|Gamma}}(''z'') {{=}} {{int|0|infty|''e''{{^|{{op|-}}{{sp|1}}''t''}}{{sp|2}}''t''{{^|{{sp|2}}''z''{{sp|1}}{{op|-}}1}}{{sp|3}}{{d|''t''}}}}|&}} after{{repeat|2|{{nl}}{{repeat|5|yadda{{nbsp}}}}}}


yields the text style HTML+CSS

: {{repeat|2|{{repeat|5|yadda{{nbsp}}}}{{nl}}}}before {{math|{{Gr|Gamma|tex}}(''z'') {{=}} {{int|0|infty|''e''{{^|{{op|-}}{{sp|1|tex}}''t''|tex}}{{sp|2|tex}}''t''{{^|{{sp|1|tex}}''z''{{op|-}}1|tex}}{{sp|3|tex}}{{d|''t''|tex}}|tex}}|}} after{{repeat|2|{{nl}}{{repeat|5|yadda{{nbsp}}}}}}  yields the text style LaTeX yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda before${\displaystyle \textstyle {\Gamma (z)=\int _{0}^{\infty }\;{e^{{\,}-{\,}{\;\;\!\!\!}t}{\;\!}t^{{\;\;\!\!\!}z{\,}-{\,}1}{\,}d^{}t}}}$ after yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda The code {{indent}}{{math|{{Gr|Gamma}}(''z'') {{=}} {{int|0|infty|''e''{{^|{{op|-}}{{sp|1}}''t''}}{{sp|2}}''t''{{^|{{sp|2}}''z''{{sp|1}}{{op|-}}1}}{{sp|3}}{{d|''t''}}|HTM}}|&&}}  yields the display style HTML+CSS Γ(z) =  ∞ 0 e − t t z − 1dt The code {{indent}}{{math|{{Gr|Gamma|tex}}(''z'') {{=}} {{int|0|infty|''e''{{^|{{op|-}}{{sp|1|tex}}''t''|tex}}{{sp|2|tex}}''t''{{^|{{sp|1|tex}}''z''{{op|-}}1|tex}}{{sp|3|tex}}{{d|''t''|tex}}|TEX}}|}}  yields the display style LaTeX ${\displaystyle {\begin{array}{l}\displaystyle {\Gamma (z)=\int _{0}^{\infty }\;{e^{-{\;\;\!\!\!}t}{\;\!}t^{{\;\;\!\!\!}z-1}{\,}d^{}t}}\end{array}}}$ #### Maxwell's equations The code {{indent}}{{math| {{begin|align}} {{oiint|{{d|''V''|part}}||{{vec|E|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{&=}} <!-- -->{{frac|1|''{{Gr|epsilon}}''{{sub|0}}|HTM}} {{iiint|''V''||''{{Gr|rho}}''{{sp|3}}{{d|''V''}}|HTM}} {{\\}} {{oiint|{{d|''V''|part}}||{{vec|B|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{&=}} 0 {{\\}} {{oint|{{d|''S''|part}}||{{vec|E|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|x|b}}}}|HTM}} {{&=}} <!-- -->{{op|−}}{{iint|''S''||{{partial|{{vec|B|b}}|''t''|HTM}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{\\}} {{oint|{{sym|partial}}''S''||{{vec|B|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|x|b}}}}|HTM}} {{&=}} <!-- -->{{iint|''S''||{{(|''{{Gr|mu}}''{{sub|0}}{{sp|1}}{{vec|J|b}} + {{frac|1|''c''{{^|2}}|HTM}} <!-- -->{{partial|{{vec|E|b}}|''t''|HTM}}|)|Big}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{\\}} {{end|align}} |tex = \begin{align} \mathit{\oiint}_{\partial V} \ \mathbf{E} \sdot d\mathbf{S} &= <!-- -->\frac{1}{\epsilon_0} \iiint_V \rho \, dV \\ \mathit{\oiint}_{\partial V} \ \mathbf{B} \sdot d\mathbf{S} &= 0 \\ \oint_{\!\!\!\!\! \partial S} \mathbf{E} \sdot d\mathbf{x} &= <!-- -->- \iint_S \frac{ \partial \mathbf{B} }{ \partial t } \sdot d\mathbf{S} \\ \oint_{\!\!\!\!\! \partial S} \mathbf{B} \sdot d\mathbf{x} &= <!-- -->\iint_S \left( \mu_0 \, \mathbf{J} + \frac{1}{c^2} <!-- -->\frac{ \partial \mathbf{E} }{ \partial t } \right) \sdot d\mathbf{S} \\ \end{align} |&&}}  yields the display style HTML+CSS  Error: String exceeds 10,000 character limit. and with the  option, yields the display style LaTeX {\displaystyle {\begin{array}{l}\displaystyle {\begin{aligned}{\mathit {\oiint }}_{\partial V}\ \mathbf {E} \cdot d\mathbf {S} &={\frac {1}{\epsilon _{0}}}\iiint _{V}\rho \,dV\\{\mathit {\oiint }}_{\partial V}\ \mathbf {B} \cdot d\mathbf {S} &=0\\\oint _{\!\!\!\!\!\partial S}\mathbf {E} \cdot d\mathbf {x} &=-\iint _{S}{\frac {\partial \mathbf {B} }{\partial t}}\cdot d\mathbf {S} \\\oint _{\!\!\!\!\!\partial S}\mathbf {B} \cdot d\mathbf {x} &=\iint _{S}\left(\mu _{0}\,\mathbf {J} +{\frac {1}{c^{2}}}{\frac {\partial \mathbf {E} }{\partial t}}\right)\cdot d\mathbf {S} \\\end{aligned}}\end{array}}} The code (now with one equation per {{math}} template call, with manual horizontal alignment of equal signs) {{indent}}{{math| {{oiint|{{d|''V''|part}}||{{vec|E|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{=}} <!-- -->{{frac|1|''{{Gr|epsilon}}''{{sub|0}}|HTM}} {{iiint|''V''||''{{Gr|rho}}''{{sp|3}}{{d|''V''}}|HTM}} |tex = \mathit{\oiint}_{\partial V} \ \mathbf{E} \sdot d\mathbf{S} = <!-- -->\frac{1}{\epsilon_0} \iiint_V \rho \, dV |&&}}{{clear}} {{indent}}{{math| {{oiint|{{d|''V''|part}}||{{vec|B|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{=}} 0 |tex = \mathit{\oiint}_{\partial V} \ \mathbf{B} \sdot d\mathbf{S} = 0 |&&}}{{clear}} {{indent}}{{sp|9}}{{sp|4}}{{math| {{oint|{{d|''S''|part}}||{{vec|E|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|x|b}}}}|HTM}} {{=}} <!-- -->{{op|−}}{{iint|''S''||{{partial|{{vec|B|b}}|''t''|HTM}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} |tex = {{sp|6|tex}} \oint_{\!\!\!\!\! \partial S} \mathbf{E} \sdot d\mathbf{x} = <!-- -->- \iint_S \frac{ \partial \mathbf{B} }{ \partial t } \sdot d\mathbf{S} |&&}}{{clear}} {{indent}}{{sp|9}}{{sp|4}}{{math| {{oint|{{sym|partial}}''S''||{{vec|B|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|x|b}}}}|HTM}} {{=}} <!-- -->{{iint|''S''||{{(|''{{Gr|mu}}''{{sub|0}}{{sp|1}}{{vec|J|b}} + {{frac|1|''c''{{^|2}}|HTM}} <!-- -->{{partial|{{vec|E|b}}|''t''|HTM}}|)|Big}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} |tex = {{sp|6|tex}} \oint_{\!\!\!\!\! \partial S} \mathbf{B} \sdot d\mathbf{x} = <!-- -->\iint_S \left( \mu_0 \, \mathbf{J} + \frac{1}{c^2} <!-- -->\frac{ \partial \mathbf{E} }{ \partial t } \right) \sdot d\mathbf{S} |&&}}  yields the display style HTML+CSS  ∂ V ∂ V E ⋅ dS =  1 ϵ0  V V ρdV  ∂ V ∂ V B ⋅ dS = 0  ∂ S ∂ S E ⋅ dx =  S S  ∂B ∂t ⋅ dS  ∂S ∂S B ⋅ dx =  S S  ⎛ ⎝ μ0J +  1 c 2  ∂E ∂t  ⎞ ⎠ ⋅ dS and with the  option, yields the display style LaTeX ${\displaystyle {\begin{array}{l}\displaystyle {{\mathit {\oiint }}_{\partial V}\ \mathbf {E} \cdot d\mathbf {S} ={\frac {1}{\epsilon _{0}}}\iiint _{V}\rho \,dV}\end{array}}}$ ${\displaystyle {\begin{array}{l}\displaystyle {{\mathit {\oiint }}_{\partial V}\ \mathbf {B} \cdot d\mathbf {S} =0}\end{array}}}$ ${\displaystyle {\begin{array}{l}\displaystyle {{\,\,}\oint _{\!\!\!\!\!\partial S}\mathbf {E} \cdot d\mathbf {x} =-\iint _{S}{\frac {\partial \mathbf {B} }{\partial t}}\cdot d\mathbf {S} }\end{array}}}$ ${\displaystyle {\begin{array}{l}\displaystyle {{\,\,}\oint _{\!\!\!\!\!\partial S}\mathbf {B} \cdot d\mathbf {x} =\iint _{S}\left(\mu _{0}\,\mathbf {J} +{\frac {1}{c^{2}}}{\frac {\partial \mathbf {E} }{\partial t}}\right)\cdot d\mathbf {S} }\end{array}}}$ The code (using the {{integral/nicer}} template) (now with one equation per {{math}} template call, with manual horizontal alignment of equal signs) {{indent}}{{math| {{integral/nicer|oiint|{{d|''V''|part}}||{{vec|E|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{=}} <!-- -->{{frac|1|''{{Gr|epsilon}}''{{sub|0}}|HTM}} {{integral/nicer|iiint|''V''||''{{Gr|rho}}''{{sp|3}}{{d|''V''}}|HTM}} |tex = \mathit{\oiint}_{\partial V} \ \mathbf{E} \sdot d\mathbf{S} = <!-- -->\frac{1}{\epsilon_0} \iiint_V \rho \, dV |&&}}{{clear}} {{indent}}{{math| {{integral/nicer|oiint|{{d|''V''|part}}||{{vec|B|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} {{=}} 0 |tex = \mathit{\oiint}_{\partial V} \ \mathbf{B} \sdot d\mathbf{S} = 0 |&&}}{{clear}} {{indent}}{{sp|9}}{{sp|5}}{{math| {{integral/nicer|oint|{{d|''S''|part}}||{{vec|E|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|x|b}}}}|HTM}} {{=}} <!-- -->{{op|−}}{{integral/nicer|iint|''S''||{{partial|{{vec|B|b}}|''t''|HTM}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} |tex = {{sp|6|tex}} \oint_{\!\!\!\!\! \partial S} \mathbf{E} \sdot d\mathbf{x} = <!-- -->- \iint_S \frac{ \partial \mathbf{B} }{ \partial t } \sdot d\mathbf{S} |&&}}{{clear}} {{indent}}{{sp|9}}{{sp|5}}{{math| {{integral/nicer|oint|{{sym|partial}}''S''||{{vec|B|b}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|x|b}}}}|HTM}} {{=}} <!-- -->{{integral/nicer|iint|''S''||{{(|''{{Gr|mu}}''{{sub|0}}{{sp|1}}{{vec|J|b}} + {{frac|1|''c''{{^|2}}|HTM}} <!-- -->{{partial|{{vec|E|b}}|''t''|HTM}}|)|Big}}{{sp|1}}{{op|sdot}}{{sp|1}}{{d|{{vec|S|b}}}}|HTM}} |tex = {{sp|6|tex}} \oint_{\!\!\!\!\! \partial S} \mathbf{B} \sdot d\mathbf{x} = <!-- -->\iint_S \left( \mu_0 \, \mathbf{J} + \frac{1}{c^2} <!-- -->\frac{ \partial \mathbf{E} }{ \partial t } \right) \sdot d\mathbf{S} |&&}}  yields the display style HTML+CSS ({{integral/nicer|oiint}} needs tweaking: lower limit must be a little higher)  ∂ V ∂ V E ⋅ dS =  1 ϵ0  V V ρdV  ∂ V ∂ V B ⋅ dS = 0  ∂ S ∂ S E ⋅ dx =  S S  ∂B ∂t ⋅ dS  ∂S ∂S B ⋅ dx =  S S  ⎛ ⎝ μ0J +  1 c 2  ∂E ∂t  ⎞ ⎠ ⋅ dS ## Quotient of integrals The code : {{math|<!-- -->{{frac | {{int|0|infty|''x''{{^|2{{sp|1}}''n''}}{{sp|1}}''e''{{^|{{op|-}}''a''{{sp|1}}''x''{{^|2}}}}{{sp|3}}{{d|''x''}}}}<!-- -->| {{int|0|infty|''x''{{^|2{{sp|1}}(''n''{{sp|1}}{{op|-}}1)}}{{sp|1}}''e''{{^|{{op|-}}''a''{{sp|1}}''x''{{^|2}}}}{{sp|3}}{{d|''x''}}}}<!-- -->|HTM}} {{=}} {{frac|2{{sp|1}}''n'' {{op|-}} 1|2{{sp|1}}''a''|HTM}} |tex = \frac{ \int_{0}^{\infty} x^{2n} e^{-a x^2} dx }{ \int_{0}^{\infty} x^{2(n-1)} e^{-a x^2} dx } = \frac{2n - 1}{2a} |&&}}  yields the display style HTML+CSS  ∞ 0 x 2 ne − ax 2dx  ∞ 0 x 2 (n − 1)e − ax 2dx =  2 n − 1 2 a and with the  option, yields the display style LaTeX ${\displaystyle {\begin{array}{l}\displaystyle {{\frac {\int _{0}^{\infty }x^{2n}e^{-ax^{2}}dx}{\int _{0}^{\infty }x^{2(n-1)}e^{-ax^{2}}dx}}={\frac {2n-1}{2a}}}\end{array}}}$ The code : {{math|<!-- -->{{frac | {{oiint|{{sym|partial}}{{sp|1}}{{Gr|Omega}}| |{{vec|E|b}}{{op|sdot}}{{d|{{vec|S|b}}}}}}<!-- -->| {{iiint|{{Gr|Omega}}| |''{{Gr|rho}}''{{sp|3}}{{d|''V''}}}}<!-- -->|HTM}} {{=}} {{frac|1|''{{Gr|epsilon}}''{{sub|0}}|HTM}} |tex = \frac{ \oiint_{\partial \Omega} {{vec|E|b|tex}} \sdot d{{vec|S|b|tex}} }{ \iiint_{\Omega} \rho \, dV } = \frac{1}{\epsilon_0} |&&}}  yields the display style HTML+CSS  ∂ Ω ∂ Ω E ⋅ dS  Ω Ω ρdV =  1 ϵ0 and with the \$ option, yields the display style LaTeX
${\displaystyle {\begin{array}{l}\displaystyle {{\frac {\oiint _{\partial \Omega }\mathbf {E} \cdot d\mathbf {S} }{\iiint _{\Omega }\rho \,dV}}={\frac {1}{\epsilon _{0}}}}\end{array}}}$