LatexNotes

Lesson 3 of 12

Fractions and roots

A command, two pairs of braces, and shapes that grow to fit what you put in them. About ten minutes.

After powers, fractions and roots are the shapes you will type most. Both are a command followed by braces, and both grow to fit whatever you put inside.

Fractions with \frac

\frac takes two pairs of braces: the top first, then the bottom. \frac{1}{2} gives 12\frac{1}{2}, and \frac{a+b}{c} gives a+bc\frac{a+b}{c}.

a+bc\frac{a+b}{c}

Everything on top goes in the first pair of braces and everything underneath in the second. Without braces, LaTeX takes one character for each part: \frac12 still gives 12\frac12, which you will see often, but \frac ab+c gives ab+c\frac ab+c, with only the a and the b in the fraction. Writing the braces is never wrong.

Fractions inside fractions

A fraction can sit inside another one, top or bottom:

11+1x\frac{1}{1 + \frac{1}{x}}

Inside a sentence, a fraction is drawn smaller so it fits the line, as in 12\frac{1}{2} here. \dfrac keeps it full size, 12\dfrac{1}{2}, and \tfrac makes it small anywhere. In a formula on its own line, \frac is already full size.

Slash fractions

Sometimes a fraction is better on one line: in a power, or in running text. Type a slash: a/b gives a/ba/b, and e^{x/2} gives ex/2e^{x/2}, which is easier to read than a stacked fraction squeezed into the power.

e−x/2e^{-x/2}

Square roots with \sqrt

\sqrt{...} puts its contents under a root sign, and the sign stretches over all of it: \sqrt{2} gives 2\sqrt{2}, and \sqrt{x^2 + y^2} gives x2+y2\sqrt{x^2 + y^2}.

x2+y2\sqrt{x^2 + y^2}

Other roots

For a cube root or any other, put the number in square brackets before the braces: \sqrt[3]{8} gives 83\sqrt[3]{8}, and \sqrt[n]{x} gives xn\sqrt[n]{x}.

273=3\sqrt[3]{27} = 3

Everything together

The quadratic formula uses all of it: a fraction, a square root, a power and \pm for plus or minus.

x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Practise

  1. 34\frac{3}{4}

  2. x+1x−1\frac{x+1}{x-1}

  3. 12+13=56\frac{1}{2} + \frac{1}{3} = \frac{5}{6}

  4. x2+y2\sqrt{x^2 + y^2}

  5. 273=3\sqrt[3]{27} = 3

  6. ex/2e^{x/2}

  7. 32\frac{\sqrt{3}}{2}

  8. x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

In short

  • \frac{top}{bottom} makes a fraction, and fractions can sit inside each other.
  • \dfrac keeps a fraction full size in a sentence; a slash keeps it on one line.
  • \sqrt{...} makes a square root, and \sqrt[n]{...} any other.

Next, in lesson 4: Greek letters and the symbols that are not on your keyboard.

Would you rather write it by hand?

LatexNotes turns a photo or PDF of your handwritten maths into LaTeX like this. Free to try, no sign-up.

Convert your handwriting to LaTeX →