LatexNotes

Lesson 12 of 12

A full worked solution

A complete answer to an exam question, typed step by step, then in a full LaTeX document. About fifteen minutes.

Time to put the course together. This lesson types a complete answer to an exam question, step by step, then puts it in a full LaTeX document you can compile.

The question

Find the area of the region between the curves y=x2y = x^2 and y=2xy = 2x.

Step 1: where the curves meet

Set the two equal and solve. \implies gives the long "implies" arrow, and \text writes the word "or":

x2=2x  ⟹  x(x−2)=0  ⟹  x=0 or x=2x^2 = 2x \implies x(x - 2) = 0 \implies x = 0 \text{ or } x = 2

Step 2: set up the integral

Between x=0x = 0 and x=2x = 2 the line is above the curve, so the area is the integral of the line minus the curve:

A=∫02(2x−x2) dxA = \int_0^2 (2x - x^2) \, dx

Step 3: integrate

Integrate, then evaluate between the limits with the growing square brackets from lesson 5:

A=[x2−x33]02=4−83=43A = \left[ x^2 - \frac{x^3}{3} \right]_0^2 = 4 - \frac{8}{3} = \frac{4}{3}

The whole answer, lined up

With align* from lesson 10, the working reads as one calculation:

A=∫02(2x−x2) dx=[x2−x33]02=4−83=43\begin{align*} A &= \int_0^2 (2x - x^2) \, dx \\ &= \left[ x^2 - \frac{x^3}{3} \right]_0^2 \\ &= 4 - \frac{8}{3} \\ &= \frac{4}{3} \end{align*}

In a full document

Everything so far was maths mode. A complete LaTeX file wraps it in a document: a class, the packages you need, and your text between \begin{document} and \end{document}.

LaTeX
\documentclass{article}
\usepackage{amsmath}   % align*, cases and the rest

\begin{document}

\section*{Question 1}
Find the area of the region between $y = x^2$ and $y = 2x$.

The curves meet where
\[ x^2 = 2x \implies x = 0 \text{ or } x = 2. \]
So
\begin{align*}
  A &= \int_0^2 (2x - x^2) \, dx \\
    &= \left[ x^2 - \frac{x^3}{3} \right]_0^2 \\
    &= \frac{4}{3}.
\end{align*}

\end{document}

Paste it into any LaTeX editor and compile it to get a PDF. Our LaTeX templates start you off with complete documents for problem sheets, lecture notes and more.

Practise

Type each step of the solution.

  1. x2=2x  ⟹  x=0 or x=2x^2 = 2x \implies x = 0 \text{ or } x = 2

  2. A=∫02(2x−x2) dxA = \int_0^2 (2x - x^2) \, dx

  3. [x2−x33]02\left[ x^2 - \frac{x^3}{3} \right]_0^2

  4. 4−83=434 - \frac{8}{3} = \frac{4}{3}

  5. A=∫02(2x−x2) dx=43\begin{align*} A &= \int_0^2 (2x - x^2) \, dx \\ &= \frac{4}{3} \end{align*}

What you have learnt

Over twelve lessons: maths mode, powers and subscripts, fractions and roots, Greek letters and symbols, brackets, sums, integrals and limits, functions and derivatives, vectors and sets, matrices and cases, equations over several lines, and text and spacing. That is most of what problem sheets and lecture notes need.

When you would rather not type at all, write your working by hand: LatexNotes turns a photo or PDF of handwritten maths into LaTeX like this.

For more practice, try the sixty practice formulas, or look anything up in the LaTeX reference.

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 →