Fractions, roots and sums
A maths toolkit: amsmath
- For serious maths, load the
amsmathpackage once in the preamble:
\usepackage{amsmath}
- It adds better fractions, alignment, and dozens of symbols. Almost every maths document uses it.
Fractions and roots
- A fraction is
\frac{top}{bottom}; a square root is\sqrt{...}:
\[ \frac{a + b}{2} \qquad \sqrt{x^2 + y^2} \]
- They nest happily:
\sqrt{\frac{1}{n}}is the square root of one-over-n.
Sums and integrals
- These grow to the right size automatically:
\[ \sum_{i=1}^{n} i \qquad \int_0^1 x^2 \, dx \]
- The
_sets the lower limit and^the upper limit — the same keys as powers.
Common mistakes
\frac,\sqrtor\sumin plain text.Half is \frac{1}{2}.gives! Missing $ inserted.Put them inside$...$or\[ ... \].- Forgetting
\usepackage{amsmath}. Commands such as\text{...}then give! Undefined control sequence. \sqrt{3}{x}for a cube root. The root's index goes in square brackets:\sqrt[3]{x}.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Write a fraction in the display equation. Replace the comment with \frac{1}{2} so the equation reads one-half. The amsmath package is already loaded for you.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Now use two more maths tools. In the display equation write a square root \sqrt{...} and a sum \sum, for example \[ \sqrt{2} + \sum_{i=1}^{n} i \].
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Put it all together: write the quadratic formula in display maths, \[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]. \pm is the plus-or-minus sign.