Email: info@jnma.ca

ISSN 2562-2854 (print)

ISSN 2562-2862 (online)

# MathDemo

For inline formulas, enclose the formula in $.... For displayed formulas, use $$...$$ ## Examples: $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$ $$(\frac{\sqrt x}{y^3})$$ $$\left(\frac{\sqrt x}{y^3}\right)$$ $$\lim_{x\to 0}$$ ## Hints: 1. To see how any formula was written in any question or answer, including this one, right-click on the expression it and choose “Show Math As > TeX Commands”. (When you do this, the ‘$$’ will not display. Make sure you add these. See the next point.)$$ 2. For inline formulas, enclose the formula in $.... For displayed formulas, use $$...$$.
These render differently. For example, type
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6} to show$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$(which is inline mode) or type \sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6} to show$$

i=0ni2=(n2+n)(2n+1)6

$\sum _{i=0}^{n}{i}^{2}=\frac{\left({n}^{2}+n\right)\left(2n+1\right)}{6}$

(which is display mode).

3. For Greek letters, use \alpha\beta, …, \omega: $\alpha, \beta, … \omega$$. For uppercase, use \Gamma, \Delta, …, \Omega:$$\Gamma, \Delta, …, \Omega$$.$$ 4. For superscripts and subscripts, use ^ and _. For example, x_i^2:$x_i^2$$, \log_2 x:$$\log_2 x$$.$$
5. Groups. Superscripts, subscripts, and other operations apply only to the next “group”. A “group” is either a single symbol, or any formula surrounded by curly braces {}. If you do 10^10, you will get a surprise: $10^10$$. But 10^{10} gives what you probably wanted:$$10^{10}$$. Use curly braces to delimit a formula to which a superscript or subscript applies: x^5^6 is an error; {x^y}^z is$${x^y}^z$$, and x^{y^z} is$$x^{y^z}$$. Observe the difference between x_i^2$$x_i^2$$and x_{i^2}$$x_{i^2}$$.$$ 6. Parentheses Ordinary symbols ()[] make parentheses and brackets$(2+3)[4+4]$$. Use \{and \} for curly braces$$\{\}\$.

These do not scale with the formula in between, so if you write (\frac{\sqrt x}{y^3}) the parentheses will be too small: $$(x√y3)$$

$\left(\frac{\sqrt{x}}{{y}^{3}}\right)$

. Using \left(\right) will make the sizes adjust automatically to the formula they enclose: \left(\frac{\sqrt x}{y^3}\right) is $$(x√y3)$$

$\left(\frac{\sqrt{x}}{{y}^{3}}\right)$

.

\left and\right apply to all the following sorts of parentheses: ( and ) $$(x)$$

$\left(x\right)$

[ and ] $$[x]$$

$\left[x\right]$

\{ and \} $${x}$$

$\left\{x\right\}$

| $$|x|$$

$|x|$

\vert $$|x|$$

$|x|$

\Vert $$‖x‖$$

$‖x‖$

\langle and \rangle $$⟨x⟩$$

$⟨x⟩$

\lceiland \rceil $$⌈x⌉$$

$⌈x⌉$

, and \lfloor and \rfloor $$⌊x⌋$$

$⌊x⌋$

\middle can be used to add additional dividers. There are also invisible parentheses, denoted by .\left.\frac12\right\rbrace is $$12}$$

$\frac{1}{2}\right\}$

.

If manual size adjustments are required: \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) gives $$(((((x)))))$$

$\left(\left(\left(\left(\left(x\right)\right)\right)\right)\right)$

.

7. Sums and integrals \sum and \int; the subscript is the lower limit and the superscript is the upper limit, so for example \sum_1^n $$∑n1 ∑1n . Don’t forget {…} if the limits are more than a single symbol. For example, \sum_{i=0}^\infty i^2 is ∑∞i=0i2 ∑i=0∞i2 . Similarly, \prod ∏ ∏ , \int ∫ ∫ , \bigcup ⋃ ⋃ , \bigcap ⋂ ⋂ , \iint ∬ ∬ , \iiint ∭ ∭ , \idotsint ∫⋯∫ ∫⋯∫ .$$
8. Fractions There are three ways to make these\frac ab applies to the next two groups, and produces $$ab ab ; for more complicated numerators and denominators use {…}: \frac{a+1}{b+1} is a+1b+1 a+1b+1 . If the numerator and denominator are complicated, you may prefer \over, which splits up the group that it is in: {a+1\over b+1} is a+1b+1 a+1b+1 . Using \cfrac{a}{b}command is useful for continued fractions ab ab , more details for which are given in this sub-article.$$
9. Fonts
• Use \mathbb or \Bbb for “blackboard bold”: $$ℂℍℕℚℝℤ CHNQRZ .$$
• Use \mathbf for boldface: $$ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz .$$
• Use \mathit for italics: $$ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz .$$
• Use \pmb for boldfaced italics: $$ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz .$$
• Use \mathtt for “typewriter” font: $$𝙰𝙱𝙲𝙳𝙴𝙵𝙶𝙷𝙸𝙹𝙺𝙻𝙼𝙽𝙾𝙿𝚀𝚁𝚂𝚃𝚄𝚅𝚆𝚇𝚈𝚉 ABCDEFGHIJKLMNOPQRSTUVWXYZ 𝚊𝚋𝚌𝚍𝚎𝚏𝚐𝚑𝚒𝚓𝚔𝚕𝚖𝚗𝚘𝚙𝚚𝚛𝚜𝚝𝚞𝚟𝚠𝚡𝚢𝚣 abcdefghijklmnopqrstuvwxyz .$$
• Use \mathrm for roman font: $$ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz .$$
• Use \mathsf for sans-serif font: $$𝖠𝖡𝖢𝖣𝖤𝖥𝖦𝖧𝖨𝖩𝖪𝖫𝖬𝖭𝖮𝖯𝖰𝖱𝖲𝖳𝖴𝖵𝖶𝖷𝖸𝖹 ABCDEFGHIJKLMNOPQRSTUVWXYZ 𝖺𝖻𝖼𝖽𝖾𝖿𝗀𝗁𝗂𝗃𝗄𝗅𝗆𝗇𝗈𝗉𝗊𝗋𝗌𝗍𝗎𝗏𝗐𝗑𝗒𝗓 abcdefghijklmnopqrstuvwxyz .$$
• Use \mathcal for “calligraphic” letters: $$ ABCDEFGHIJKLMNOPQRSTUVWXYZ$$
• Use \mathscr for script letters: $$𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵 ABCDEFGHIJKLMNOPQRSTUVWXYZ$$
• Use \mathfrak for “Fraktur” (old German style) letters: $$𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz .$$
10. Radical signs Use sqrt, which adjusts to the size of its argument: \sqrt{x^3} $$x3‾‾√ x3 ; \sqrt[3]{\frac xy} xy‾‾√3 xy3 . For complicated expressions, consider using {...}^{1/2}instead.$$
11. Some special functions such as “lim”, “sin”, “max”, “ln”, and so on are normally set in roman font instead of italic font. Use \lim\sin, etc. to make these: \sin x $$sinx sin⁡x , not sin x sinx sinx . Use subscripts to attach a notation to \lim: \lim_{x\to 0} limx→0 limx→0$$
12. There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this exhaustive listing. Some of the most common include:
• \lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq $$<>≤≤≦⩽≥≥≧⩾≠ <>≤≤≦⩽≥≥≧⩾≠ . You can use \not to put a slash through almost anything: \not\lt ≮ ≮ but it often looks bad.$$
• \times \div \pm \mp $$×÷±∓ ×÷±∓ . \cdot is a centered dot: x⋅y x⋅y$$
• \cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing $$∪∩∖⊂⊆⊊⊃∈∉∅∅ ∪∩∖⊂⊆⊊⊃∈∉∅∅$$
• {n+1 \choose 2k} or \binom{n+1}{2k} $$(n+12k) (n+12k)$$
• \to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto $$→→←⇒⇐↦ →→←⇒⇐↦$$
• \land \lor \lnot \forall \exists \top \bot \vdash \vDash $$∧∨¬∀∃⊤⊥⊢⊨ ∧∨¬∀∃⊤⊥⊢⊨$$
• \star \ast \oplus \circ \bullet $$⋆∗⊕∘∙ ⋆∗⊕∘∙$$
• \approx \sim \simeq \cong \equiv \prec \lhd \therefore $$≈∼≃≅≡≺⊲∴ ≈∼≃≅≡≺⊲∴$$
• \infty \aleph_0 $$∞ℵ0 ∞ℵ0 \nabla \partial ∇∂ ∇∂ \Im \Re ℑℜ ℑℜ$$
• For modular equivalence, use \pmod like this: a\equiv b\pmod n $$a≡b(modn) a≡b(modn) .$$
• \ldots is the dots in $$a1,a2,…,an a1,a2,…,an \cdots is the dots in a1+a2+⋯+an a1+a2+⋯+an$$
• Some Greek letters have variant forms: \epsilon \varepsilon $$ϵε ϵε , \phi \varphi ϕφ ϕφ , and others. Script lowercase l is \ell ℓ ℓ .$$