courses › Beyond College

Numerical methods

level 54 course

How computers find roots and areas step by step.

Pen and paper is fine · no calculator needed why?

Learn first (about 3 minutes)

Opens at level 54.

Sign in to start

Builds on: Using derivatives (not open yet) · Integrals (not open yet)

the lesson

The idea, the techniques and a tip for each skill, right here. The Learn page adds worked examples for every skill and untimed practice.

Read the lesson · about 3 minutes

The idea

Many equations and integrals have no tidy formula, so computers approximate them with fixed recipes.

Newton’s method moves a guess to where the tangent line meets the x-axis, usually closer to the root. Bisection halves an interval that holds a root. The trapezoid rule and Simpson’s rule estimate the area under a curve from its heights at equally spaced points.

Techniques

One Newton step

Improving a guess x₀ for a root of f(x) = 0.

  1. Work out f(x₀) and the slope f′(x₀).
  2. x₁ = x₀ − f(x₀)/f′(x₀): where the tangent line crosses the x-axis.
worked example

Example: Apply one step of Newton’s method to f(x) = x² − 7, starting from x₀ = 3. What is x₁? Give an exact fraction.

  1. f(3) is 9 − 7, which is 2. f′(x) is 2x, so f′(3) is 6.
  2. x₁ = 3 − 2/6 = 3 − 1/3 = 8/3.

Answer: 8/3

Halve and keep the sign change

f(a) and f(b) have opposite signs, so a root lies between a and b.

  1. Find the sign of f at the midpoint.
  2. Keep the half whose ends give opposite signs. Repeat as many times as asked.
  3. Answer with the midpoint of the last interval.
worked example

Example: Start with [1, 2] for f(x) = x² − 2. Test the midpoint and keep the half where f changes sign. Do this twice. What is the midpoint of the interval you end with? Give the answer as a decimal.

  1. f(1) is negative. f(1.5) is 0.25, positive: keep [1, 1.5].
  2. f(1.25) is −0.4375, negative: keep [1.25, 1.5].
  3. Its midpoint is 1.375.

Answer: 1.375

Weight the heights

Estimating an integral from heights at equally spaced points, h apart.

  1. Work out f at each point.
  2. Trapezoid rule: weights 1, 2, 2, …, 2, 1, then multiply the sum by h/2.
  3. Simpson’s rule, 2 strips: weights 1, 4, 1, then multiply by h/3. It is exact for polynomials up to x³.
worked example

Example: Use the trapezoid rule with 2 strips of width 1 to estimate ∫₁³ x² dx. Give the estimate as a decimal.

  1. At x = 1, 2 and 3, x² is 1, 4 and 9.
  2. 1 + 2 × 4 + 9 = 18.
  3. Times h/2: 18 ÷ 2 = 9.
  4. The exact value is 26/3 ≈ 8.67, so the estimate is a little high.

Answer: 9

Tips by skill

  • TipNewton’s method: x₁ = x₀ − f(x₀)/f′(x₀). Find f and its slope at x₀, and watch the sign of f(x₀).
  • TipBisection: Each time, test the midpoint and keep the half whose ends give opposite signs. Answer with the last interval’s midpoint.
  • TipTrapezoid rule: Weights 1, 2, 2, …, 2, 1 on the heights, then multiply the sum by half the strip width.
  • TipSimpson’s rule: Weights 1, 4, 1 on the three heights, then multiply the sum by a third of the strip width.

Watch out for

  • Getting the sign of the Newton step wrong. When f(x₀)/f′(x₀) is negative, subtracting it makes x₁ bigger than x₀.
  • Giving the last point you tested instead of the midpoint of the last interval.
  • Forgetting to double the inside heights, or using the trapezoid weights for Simpson’s rule.

skills · practice stats

From rounds of this course only: box, review and test-out answers are left out. Once a skill has 40 tries, it compares your first 20 tries with your last 20.

rest ladder

Win 3 of your last 4 rounds and the course rests. A win is 90% right, within 2× the round's par. Pass the review when it comes back and the next rest is longer.

  1. 1 day
  2. 3 days
  3. 7 days
  4. 14 days
  5. 30 days
  6. 60 days
  7. mastered · every 90 days

your rounds

No rounds yet.