Finds a root
Newton's method
Find where a curve meets the -axis. Follow the tangent line to the -axis. The point where it meets the axis is your next guess. Do it again from there.
Calculus · Newton's method and Euler's method
Two methods, one idea: follow the tangent line. Learn the formula and the table, watch them move, then solve 34 questions, most of them from past finals.
Zoom in close to a point on a curve. The curve looks more and more like a straight line: its tangent line. Newton's method and Euler's method both use this idea, again and again.
Far away, the curve clearly bends away from its tangent line.
The linear approximation
for x close to a
The tangent line needs only two numbers: the height f(a) and the slope f′(a). Close to a it is almost the same as the curve. This is the linear approximation you already know.
The big idea
Newton's method and Euler's method are the linear approximation, used one step at a time.
Finds a root
Find where a curve meets the x-axis. Follow the tangent line to the x-axis. The point where it meets the axis is your next guess. Do it again from there.
xn+1=xn−f′(xn)f(xn)
Follows a changing quantity
You know where y starts and the rule for its slope, dtdy. Follow the tangent line for one short step. The point where you stop is your next point. Do it again from there.
yn+1=yn+h⋅F(tn,yn)
Both methods repeat one small calculation. The answer of one round is the start of the next round. Repeating like this is called iterating. One round is one iteration, or one step.
Count the steps, not the numbers
From x0 to x2 is two steps: x0→x1→x2. Some older exams start at x1. Then two steps go from x1 to x3. Read which number the question starts with.
Why the little n?
The formula is the same in every step. So it is written once, with n: put n=0 for the first step, n=1 for the second, and so on.
| Newton's method | Euler's method | |
|---|---|---|
| What it finds | A root: an x where f(x)=0. | A later value: y at a later time t. |
| You are given | f(x), and a start x0. | dtdy=F(t,y), a start y(t0)=y0, and a step size h (or a number of steps). |
| One step | xn+1=xn−f′(xn)f(xn) | yn+1=yn+h⋅F(tn,yn) |
| The tangent line is | followed to the x-axis. | followed for one step of length h. |
| Do you differentiate? | Yes: you find f′(x) yourself. | No: the equation gives the slope. |
| It gets better with | more steps. It is very fast. | smaller steps (more of them). |
| The answer is | the last x. | the last y. |
Newton's method finds a root of a function: a number x where f(x)=0. You start with a guess. Most of the time, each step makes the guess better.
What it can do
When to use it: the question says…
next guess = guess − height ÷ slope
Start at the point (xn,f(xn)) on the curve and draw the tangent line there. Follow it to the x-axis.
In the picture the point is above the axis, so the line has to go down by the height f(xn). Its slope is f′(xn). Slope is rise ÷ run, so the run along the axis is
run=f′(xn)f(xn).
So the line meets the axis at xn−f′(xn)f(xn). That point is the next guess. The formula is the same when the point is below the axis: then f(xn) is negative.
What matters on the exam
Newton's method finds where the tangent line meets the x-axis. You do not need to show where the formula comes from. You need the formula, and how to use it.
Each step is done on the same small example.
The exampleUse Newton's method with x0=2 to approximate 5. Find x1 and x2.
Example5 solves x2=5. So f(x)=x2−5.
Examplef′(x)=2x
ExampleThe question gives x0=2. It is a good start, because 22=4 is close to 5.
Examplef(2)=−1, f′(2)=4, so x1=2−4−1=49.
Examplex2=49−9/21/16=49−721=72161
Write f and f′ first. Then make a table with one row for each step, and fill it one row at a time. Press Next row to see how.
On your exam paper
f(x)=x2−5
f′(x)=2x
xn+1=xn−2xnxn2−5
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 2 | −1 | 4 | 49 |
f(2)=22−5=−1 and f′(2)=2(2)=4. So x1=2−4−1=2+41=49.
5≈x2=72161
Choose a function. Drag the start along the x-axis, then press Next step. Watch the guesses get closer to the root. After a few steps the picture zooms in, because the guesses are so close together.
Drag x₀ along the x-axis, or press Next step.
| n | xₙ | f(xₙ) | f′(xₙ) | xₙ₊₁ |
|---|---|---|---|---|
| The rows appear as you go. | ||||
The decimals here show how fast the guesses get close to the root. On the exam you keep fractions.
Newton's method is fast, but it does not always work. Four things can go wrong, and exams often ask about them.
If f′(xn)=0, the tangent line is flat. It never meets the x-axis, and the formula divides by 0. Choose another start.
The guesses can come back to a number you already had. Then the same steps repeat forever, and they never reach the root.
For f(x)=3x every tangent line meets the axis too far away, on the other side of the root. Each guess is twice as far from the root as the one before.
A nearly flat tangent line sends the next guess far away, past other roots. Newton's method does not always find the root closest to the start.
A good start avoids most of this
Start close to the root. Try whole numbers in f: where f changes sign (from − to +, or + to −), a root is in between. Start at one of these two numbers, usually the one where f is closer to 0. If f′ is 0 there, or the guesses move away, use the other one.
From the December 2016 final: which zero does each start find? Try it
Ready? See every kind of Newton question from past finals, oldest first.
Newton questions →Four kinds of question, with questions from past UBC finals (oldest first) and new ones where the old papers have none. Read a question, try it on paper, then open the solution one step at a time. Press Colour-code to see the function, the start and what to find in the formula's colours.
4 kinds · 21 questions · 17 from past finals (2005 to 2016)
The past final questions are from UBC final exams. The solutions are written by Learn4Less. Learn4Less is not affiliated with UBC.
6 questions, 6 from past finals
What it looks like
The question gives an equation that already has 0 on one side (or a function f), and a start: x0, or x1 on older papers. It asks for x1, x2 or x3.
What to do
Find f′(x). Count how many steps go from the start to the x they ask for. Make the table and fill one row for each step.
Past final · Dec 2005 · MATH 100A · Question 1(j) · 3 marks
Using Newton's Method, starting with x1=2, find the approximation x3 to the root of the equation 20x−x3−24=0.
The equation already has 0 on the right side. So f(x)=20x−x3−24.
f′(x)=20−3x2. The 20x gives 20, the −x3 gives −3x2, and the constant −24 gives 0.
This paper starts at x1, not at x0. From x1 to x3 you go x1→x2→x3. That is two steps, so the table has two rows.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | 2 | 8 | 8 | 1 |
| 2 | 1 | −5 | 17 | 1722 |
f(2)=20(2)−23−24=40−8−24=8 and f′(2)=20−3(2)2=20−12=8. So x2=2−88=2−1=1.
f(1)=20(1)−13−24=20−1−24=−5 and f′(1)=20−3(1)2=17. So x3=1−17−5=1+175=1717+175=1722.
The last column uses xn+1=xn−f′(xn)f(xn). The new x at the end of a row is the x at the start of the next row.
Past final · Dec 2006 · MATH 100B · Question 7(c) · 3 marks
In trying to solve the equation x3+5x−3=0 using Newton's method, our initial guess is x0=1. What is x1? The answer should use fractions, not decimals.
The equation already has 0 on the right side. So f(x)=x3+5x−3.
f′(x)=3x2+5. The power rule: x3 gives 3x2. The 5x gives 5, and the constant −3 gives 0.
From x0 to x1 is one step: one row.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 1 | 3 | 8 | 85 |
f(1)=13+5(1)−3=1+5−3=3 and f′(1)=3(1)2+5=8. So x1=1−83=88−83=85.
The last column uses xn+1=xn−f′(xn)f(xn).
Past final · Dec 2009 · MATH 100A · Question 1(m) · 3 marks
Newton's Method is used to approximate a solution of the equation x+lnx=0, starting with the initial approximation x1=1. Find x2.
The equation already has 0 on the right side. So f(x)=x+lnx.
f′(x)=1+x1. The x gives 1, and the derivative of lnx is x1.
From x1 to x2 is one step: one row.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | 1 | 1 | 2 | 21 |
f(1)=1+ln1=1+0=1, because ln1=0. And f′(1)=1+11=2. So x2=1−21=21.
The last column uses xn+1=xn−f′(xn)f(xn).
Past final · Dec 2010 · MATH 100A · Question 1(m) · 3 marks
Newton's Method is used to approximate a solution of the equation ex−x2=0, starting with the initial approximation x1=0. Find x3.
The equation already has 0 on the right side. So f(x)=ex−x2.
f′(x)=ex−2x. The derivative of ex is ex, and −x2 gives −2x.
From x1 to x3 is two steps: x1→x2→x3. The table has two rows.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | 0 | 1 | 1 | −1 |
| 2 | −1 | e−1−1 | e−1+2 | −1−e−1+2e−1−1 |
f(0)=e0−02=1−0=1, because e0=1. And f′(0)=e0−2(0)=1. So x2=0−11=−1.
f(−1)=e−1−(−1)2=e−1−1 and f′(−1)=e−1−2(−1)=e−1+2. So x3=−1−e−1+2e−1−1.
The last column uses xn+1=xn−f′(xn)f(xn). The new x at the end of a row is the x at the start of the next row.
You may leave e−1 in the answer: the question does not ask you to simplify, and there is no calculator.
If you want a shorter form, multiply the top and the bottom of the fraction by e. It becomes 1+2e1−e. Then
x3=−1−1+2e1−e=1+2e−(1+2e)−(1−e)=−2e+1e+2.
It is the same number.
Past final · Dec 2013 · MATH 100A · Question 4(a) · 3 marks
Use Newton's method with an initial approximation of x1=−1 to find x2, where x2 is the second approximation to the root of the equation x7+4=0.
The equation already has 0 on the right side. So f(x)=x7+4.
f′(x)=7x6. The power rule: x7 gives 7x6. The constant 4 gives 0.
From x1 to x2 is one step. Be careful with −1: an odd power of −1 is −1, and an even power is 1. So (−1)7=−1 and (−1)6=1.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | −1 | 3 | 7 | −710 |
f(−1)=(−1)7+4=−1+4=3 and f′(−1)=7(−1)6=7(1)=7. So x2=−1−73=−77−73=−710.
The last column uses xn+1=xn−f′(xn)f(xn).
Past final · Apr 2014 · MATH 100A · Question 1(n) · 3 marks
Use Newton's method with an initial approximation of x1=1 to find x2, where x2 is the second approximation to the root of the equation x5−x−1=0.
The equation already has 0 on the right side. So f(x)=x5−x−1.
f′(x)=5x4−1. The power rule: x5 gives 5x4. The −x gives −1, and the constant −1 gives 0.
From x1 to x2 is one step. Be careful with the two minus signs: minus a negative number is plus.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | 1 | −1 | 4 | 45 |
f(1)=15−1−1=−1 and f′(1)=5(1)4−1=4. So x2=1−4−1=1+41=45.
The last column uses xn+1=xn−f′(xn)f(xn).
7 questions, 7 from past finals
What it looks like
The question asks for a number like 48 or 62, or gives an equation with x on both sides like sinx=1−x, or asks where two graphs meet.
What to do
Write an equation whose solution is what you want. Move everything to one side. That side is f(x). Then do the steps as usual.
Past final · Dec 2007 · MATH 100A · Question 1(m) · 3 marks
Newton's Method is used to approximate a positive solution of the equation sinx=x2, starting with the initial approximation x1=1. Find x2. Remember: you do not need to simplify your answer.
Move x2 to the left side: sinx−x2=0. So f(x)=sinx−x2.
f′(x)=cosx−2x. The derivative of sinx is cosx, and −x2 gives −2x.
From x1 to x2 is one step.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | 1 | sin1−1 | cos1−2 | 1−cos1−2sin1−1 |
f(1)=sin1−12=sin1−1 and f′(1)=cos1−2(1)=cos1−2. So x2=1−cos1−2sin1−1.
The last column uses xn+1=xn−f′(xn)f(xn).
Here 1 means 1 radian, and sin1 is not a value you know. That is fine: the question says you do not need to simplify. Stop at the formula.
Past final · Dec 2008 · MATH 100A · Question 1(m) · 3 marks
Newton's Method is used to approximate a solution of the equation sinx=1−x, starting with the initial approximation x1=π/2. Find x2.
Move everything to the left side: sinx−1+x=0. So f(x)=sinx−1+x.
f′(x)=cosx+1. The derivative of sinx is cosx, the constant −1 gives 0, and the x gives 1.
From x1 to x2 is one step. You need sin2π=1 and cos2π=0.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | 2π | 2π | 1 | 0 |
f(2π)=sin2π−1+2π=1−1+2π=2π and f′(2π)=cos2π+1=0+1=1. So x2=2π−1π/2=2π−2π=0.
The last column uses xn+1=xn−f′(xn)f(xn).
Past final · Dec 2008 · MATH 100B · Question 6(c)
The graphs of h(x)=sin(x) and g(x)=2x meet at x=0, and at one more point with x>0. Use Newton's method with the initial guess x0=π to find an improved estimate, x1, for that point of intersection of the two graphs. Leave your answer as a simplified fraction in terms of π. Do not compute a decimal approximation.
The graphs meet where h(x)=g(x), so where sinx=2x. Move everything to one side: f(x)=sinx−2x. A root of f is a point where the graphs meet.
f′(x)=cosx−21. The derivative of sinx is cosx, and −2x gives −21.
From x0 to x1 is one step. You need sinπ=0 and cosπ=−1. To divide by a fraction, flip it and multiply.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | π | −2π | −23 | 32π |
f(π)=sinπ−2π=0−2π=−2π and f′(π)=cosπ−21=−1−21=−23. The fraction is −3/2−π/2=2π⋅32=3π. So x1=π−3π=33π−3π=32π.
The last column uses xn+1=xn−f′(xn)f(xn).
Past final · Dec 2009 · MATH 100B · Question 7(c) · 4 marks
Consider the function f(x)=10ln(x2+1)−x2. The value f(1) is close to 6. Suppose we use Newton's method to find the solution of f(x)=6, starting with the initial guess x0=1. Find x1.
Newton's method finds where a function is 0, and this question asks where f is 6. So move the 6 to the left side: f(x)−6=0. Give the new function its own name:
g(x)=10ln(x2+1)−x2−6.
Now use Newton's method on g, not on f. (Using f would find where f(x)=0, a different question.)
The chain rule on ln(x2+1) gives x2+12x, so 10ln(x2+1) gives x2+120x. The −x2 gives −2x, and the constant −6 gives 0. So
g′(x)=x2+120x−2x.
It is the same as f′(x).
From x0 to x1 is one step. The table is the same as always, with g in place of f.
n step | xn guess | g(xn) height | g′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 1 | 10ln2−7 | 8 | 1−810ln2−7 |
g(1)=10ln(12+1)−12−6=10ln2−7 and g′(1)=12+120(1)−2(1)=10−2=8. So x1=1−810ln2−7=88−(10ln2−7)=88−10ln2+7=815−10ln2. The minus sign in front changes both signs in the brackets.
The last column uses xn+1=xn−g′(xn)g(xn).
ln2 stays as it is: there is no calculator, and the answer is exact.
Past final · Dec 2011 · MATH 100A · Question 1(m) · 3 marks
Use Newton's Method to find the second approximation x2 to 62, starting with the initial approximation x1=1.
62 is the number whose sixth power is 2. So it solves x6=2, which is x6−2=0. Use f(x)=x6−2.
f′(x)=6x5. The power rule: x6 gives 6x5. The constant −2 gives 0.
From x1 to x2 is one step.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 1 | 1 | −1 | 6 | 67 |
f(1)=16−2=−1 and f′(1)=6(1)5=6. So x2=1−6−1=1+61=67.
The last column uses xn+1=xn−f′(xn)f(xn).
Past final · Dec 2012 · MATH 100B · Question C.3 · 10 marks
This question is about approximating the value of b=48.
(a) Between which two successive integers does b lie?
(b) Use a linear approximation to estimate b. Is your estimate larger or smaller than the actual value? Justify your claim.
(c) Determine an appropriate function that has a zero at b and apply one iteration of Newton's method (i.e. find x1) to estimate b starting with an initial guess x0 that is the nearest integer to the actual value.
62=36 and 72=49. Since 36<48<49, we get 6<48<7. And 48 is very close to 49, so 48 is very close to 7.
Use g(x)=x at a=49, where you know the square root: g(49)=7. The derivative is g′(x)=2x1, so g′(49)=141. The tangent line gives
48≈7+141(48−49)=7−141=1497.
It is larger than 48. The reason: g′′(x)=−41x−3/2<0, so x is concave down. A concave-down curve is below its tangent lines, so the tangent line gives a value that is too big.
48 solves x2=48. Use f(x)=x2−48. Then f′(x)=2x: the power rule on x2 gives 2x, and the constant −48 gives 0. The nearest whole number to 48 is x0=7.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 7 | 1 | 14 | 1497 |
f(7)=72−48=49−48=1 and f′(7)=2(7)=14. So x1=7−141=1498−141=1497.
The last column uses xn+1=xn−f′(xn)f(xn).
Look: Newton's x1 is the same number as the linear approximation in (b). There is a reason. Both of them use a tangent line in place of a curve.
Past final · Dec 2014 · MATH 100B · Question A.8 · 2 marks
In order to calculate arcsin(0.4) using Newton's method, which of the following would be the appropriate formula?
Call the number x=arcsin(0.4). Then sinx=0.4, so x solves sinx−0.4=0. Use f(x)=sinx−0.4. (Taking sin of both sides removes the arcsin.)
f′(x)=cosx. The derivative of sinx is cosx, and the constant −0.4 gives 0.
xn+1=xn−cos(xn)sin(xn)−0.4.
That is choice C.
Choices A and B are not Newton's method: they have no xn in them. Choice D uses arcsinx−0.4. Its root is x=sin(0.4), a different number. And arccosx is not the derivative of arcsinx.
4 questions, 4 from past finals
What it looks like
The question gives a tangent line, or the two numbers f(a) and f′(a), or a graph, instead of a formula for f.
What to do
Newton's next guess is where the tangent line meets the x-axis.
Past final · Dec 2010 · MATH 100C · Question 1(g) · 3 marks
You are using the Newton-Raphson Method to approximate a solution of an equation f(x)=x, and you make an initial guess x0=3 to the solution. If the tangent line to y=f(x) at x=3 has the equation y=5x−7, what is the next approximation x1 to the solution?
The Newton-Raphson method is another name for Newton's method. The equation is f(x)=x. Move the x to the left side: f(x)−x=0. So use g(x)=f(x)−x. Its derivative is g′(x)=f′(x)−1, because −x gives −1. (Be careful: Newton's method on f itself would solve f(x)=0, a different equation.)
The tangent line touches the curve at x=3, so it has the same height there: f(3)=5(3)−7=8. Its slope is the derivative: f′(3)=5.
From x0 to x1 is one step.
n step | xn guess | g(xn) height | g′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 3 | 5 | 4 | 47 |
g(3)=f(3)−3=8−3=5 and g′(3)=f′(3)−1=5−1=4. So x1=3−45=412−45=47.
The last column uses xn+1=xn−g′(xn)g(xn).
Use the tangent line in place of f and solve: 5x−7=x gives 4x=7, so x=47. It is the same answer, because one Newton step uses the tangent line in place of the curve.
Past final · Dec 2013 · MATH 100B · Question A.4 · 2 marks
Shown in the figure below is a function and its tangent line at x=x0. The tangent line intersects the x-axis at the point x=x1. The coordinate of the point x1 is
It goes through the point (x0,f(x0)) with slope f′(x0):
y=f(x0)+f′(x0)(x−x0).
On the x-axis, y=0. So 0=f(x0)+f′(x0)(x1−x0). Subtract f(x0) from both sides, then divide both sides by f′(x0): x1−x0=−f′(x0)f(x0). So
x1=x0−f′(x0)f(x0).
That is choice E, Newton's formula. In the picture f(x0)>0 and f′(x0)>0, so x1 is to the left of x0: we subtract.
A adds where it should subtract: it gives a point to the right of x0, and the line meets the axis on the left. B still has an x in it. C and D use values at x1, which you do not know yet, and they turn the fraction upside down.
Past final · Dec 2013 · MATH 100C · Question 1(m) · 3 marks
Let f be a differentiable function such that f(3)=2 and f′(3)=5. If the tangent line to the graph of f at a=3 is used to approximate f(x), then an approximate solution for x to the equation f(x)=0 is
"Use the tangent line to solve f(x)=0" is one step of Newton's method from x0=3. You do not need a formula for f: the step only uses f(3) and f′(3), and the question gives both.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 3 | 2 | 5 | 513 |
x1=3−52=515−52=513, and 513=2.6.
The last column uses xn+1=xn−f′(xn)f(xn).
2.6 is choice C. The other choices: A is only the fraction 52=0.4. D adds where it should subtract: 3+52=3.4. B and E turn the fraction upside down: 3−25=0.5 and 3+25=5.5.
Past final · Dec 2016 · MATH 100B · Question 9 · 4 marks
The zeros of the quartic function f(x) are labelled from z1 to z4, running left to right. Using Newton's method, starting at the points x0=A,B,C, and D (black dots), which zero will be found? Several relevant tangent lines have been provided (dashed lines). No justification is required for this problem.
From each start, go up or down to the curve. Then follow the tangent line to the x-axis. The point where it meets the axis is the next guess. Repeat until the guesses stay close to one zero. Press a letter to see it:
Press a letter. The guesses are drawn one step at a time.
A is close to z1, on a steep part of the curve. Its tangent line meets the axis very close to z1, so it finds z1. The tangent line at D meets the axis between z2 and z3. From there the next guesses get closer and closer to z3.
At B and C the curve is nearly flat: they are near the lowest point of the curve between z2 and z3. A nearly flat tangent line meets the axis far away. From B it meets the axis left of z1, and Newton's method then finds z1. From C it meets the axis right of z4, and Newton's method finds z4. Neither one finds the zero that is nearest to its start.
4 questions
What it looks like
The question asks if the guesses will converge (get closer and closer to a root), asks why the method fails, or gives a start where something goes wrong.
What to do
Do two or three steps and look at the numbers. Look for a slope of 0, a guess you already had, guesses that move farther away, or guesses going to a different root than the one you want.
New problem
Let f(x)=x3−2x+2. Start Newton's method at x0=0 and find x1, x2 and x3. Will the guesses converge to the root of f?
f′(x)=3x2−2. The power rule: x3 gives 3x2. The −2x gives −2, and the constant 2 gives 0.
Three steps: x0→x1→x2→x3.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 0 | 2 | −2 | 1 |
| 1 | 1 | 1 | 1 | 0 |
| 2 | 0 | 2 | −2 | 1 |
f(0)=03−2(0)+2=2 and f′(0)=3(0)2−2=−2. So x1=0−−22=0+1=1.
f(1)=13−2(1)+2=1 and f′(1)=3(1)2−2=1. So x2=1−11=0.
We are back at 0, so this row is the same as the first row: x3=1.
The last column uses xn+1=xn−f′(xn)f(xn). The new x at the end of a row is the x at the start of the next row.
No. x2=0 is the start again. Each step uses only the guess before it, so from here the same two steps repeat forever: 0,1,0,1,… This is called a cycle.
The guesses never get close to the root. The root is between −2 and −1, because f(−2)=−2<0 and f(−1)=3>0. A start like x0=−2 works well.
New problem
Let f(x)=x3−3x+1.
(a) Explain why Newton's method cannot start at x0=1.
(b) Start at x0=2 instead, and find x1.
f′(x)=3x2−3: the power rule on x3 gives 3x2, the −3x gives −3, and the constant 1 gives 0. So f′(1)=3−3=0, and the formula would divide by 0.
In the picture, the tangent line at x=1 is flat (horizontal). It never meets the x-axis, so there is no next guess.
From x0=2 to x1 is one step.
n step | xn guess | f(xn) height | f′(xn) slope | xn+1 next guess |
|---|---|---|---|---|
| 0 | 2 | 3 | 9 | 35 |
f(2)=23−3(2)+1=8−6+1=3 and f′(2)=3(2)2−3=12−3=9. So x1=2−93=2−31=35.
The last column uses xn+1=xn−f′(xn)f(xn).
New problem
Let f(x)=3x=x1/3. Its only root is x=0. Start Newton's method at x0=1 and find x1, x2 and x3. What happens?
f′(x)=31x−2/3. This is the power rule (xk)′=kxk−1 with k=31: the new power is 31−1=−32.
For any x=0:
f′(x)f(x)=31x−2/3x1/3=3x1/3+2/3=3x.
Dividing by 31 multiplies by 3, and dividing by x−2/3 adds 32 to the power. So every step is xn+1=xn−3xn=−2xn.
x1=−2(1)=−2, then x2=−2(−2)=4, then x3=−2(4)=−8.
Each guess is twice as far from the root as the one before, on the other side of it. The guesses move away from 0. Near 0 the curve is very steep, and every tangent line meets the axis too far away, on the other side of the root.
New problem
True or false: Newton's method always finds the zero that is closest to the initial guess x0.
The next guess is where the tangent line meets the x-axis. That point does not have to be near the closest zero. If the tangent line is nearly flat, it meets the axis far away, maybe past several zeros.
The December 2016 question above has this exact picture. From C the closest zero is z3. But the nearly flat tangent line sends the next guess past z4, and Newton's method finds z4. Press C to see it:
Press a letter. The guesses are drawn one step at a time.
A differential equation like dtdy=t+y gives the slope of the solution at every point. A start like y(0)=1 says where the solution begins. Euler's method finds where the solution goes next, one small step at a time, even when nobody can find a formula for it.
What it can do
When to use it: the question says…
h=number of stepsend−start.
next value = value + step size × slope
It is the linear approximation again: over a short time h,
y(t+h)≈y(t)+y′(t)⋅h.
In words: change ≈ rate × time. Here y′ means dtdy. The differential equation gives the rate y′=F(t,y) at the point where you are. Follow the tangent line for one step: y changes by h⋅F.
The new point is close to the true curve, but not on it. That small difference is the error. Smaller steps make it smaller.
Each step is done on the same small example.
The exampleUse Euler's method with two steps to estimate y(1) for dtdy=t+y, y(0)=1.
ExampleF(t,y)=t+y. Start: t0=0, y0=1.
ExampleTwo steps from t=0 to t=1: h=21.
Exampleslope=0+1=1, so y1=1+21(1)=23.
Examplet1=21: slope=21+23=2, so y2=23+21(2)=25.
Examplet2=1, so y(1)≈25.
Write the slope rule and h first. Then one row for each step. Press Next row to see how it fills in.
On your exam paper
F(t,y)=t+y
h=21−0=21
yn+1=yn+21(tn+yn)
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 23 |
F(0,1)=0+1=1. So y1=1+21(1)=23.
y(1)≈y2=25
On a slope field, each grey segment has the slope the equation gives at that point. The black curve is the true solution. Euler's method reads the slope at its point, follows a straight line with that slope for one step, then reads the slope at the new point. Choose more steps, and the path stays close to the curve.
Move the start up or down, choose the steps, then press Next step.
| n | tₙ | yₙ | slope | yₙ₊₁ |
|---|---|---|---|---|
| The rows appear as you go. | ||||
Euler's error at the end, by number of steps
With small steps, twice the steps gives about half the error.
Try y′=y from y(0)=1: the true value of y(1) is e. With m steps, Euler's method gives exactly (1+m1)m, the famous formula that gets closer and closer to e≈2.718. With 16 steps it is about 2.64.
Euler's method follows tangent lines. So the concavity of the solution decides:
Here y′ means dtdy, and y′′ is the derivative of y′. To find y′′, differentiate the equation once more. When the slope depends on y only, y′=F(y), the chain rule gives
y′′=F′(y)⋅y′.
Check its sign on the steps you took.
A step that is too big
Euler's method uses the slope at the start of a step for the whole step. Where the slope changes fast, a big step ends far from the curve. It can even cross a row of flat segments (a steady state), which a true solution never crosses. The fix is always the same: smaller steps.
Check with the slope field
Before you trust an Euler answer, look at the picture. Does it move the same way as the segments? Does it stay between the rows of flat segments? If not, the step is too big.
Ready? See every kind of Euler question from past finals, oldest first.
Euler questions →Four kinds of question, with questions from past UBC finals (oldest first) and new ones in the style of the newest finals: a slope field, a sketch, Euler's table, then "too big or too small?".
4 kinds · 13 questions · 7 from past finals (2006 to 2016)
The past final questions are from UBC final exams. The solutions are written by Learn4Less. Learn4Less is not affiliated with UBC.
3 questions, 3 from past finals
What it looks like
The question gives dtdy, a start like y(0)=2, and one step size. It asks for y one step later.
What to do
Find the slope at the start. Multiply it by the step size. Add that to the start.
Past final · Dec 2013 · MATH 100B · Question A.3 · 2 marks
Consider the differential equation and initial condition dtdy=2−y2, y(0)=1. Use Euler's method with one step of size Δt=0.1 to approximate the value of the solution at time t=0.1.
The slope is F(t,y)=2−y2. The start is t0=0, y0=1.
h=Δt=0.1, one step: from t=0 to t=0.1.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1.1 |
F(0,1)=2−12=1. So y1=1+0.1(1)=1.1.
The last column uses yn+1=yn+h⋅F(tn,yn).
1.1 is choice E. Choice A (2) is what you get if you forget to multiply the slope by Δt: 1+1=2.
Past final · Dec 2014 · MATH 100B · Question B.5 · 3 marks
Consider the differential equation dtdy=2(1−y) with the initial condition y(0)=2. Using Euler's method with a single step of size h=Δt=1/4, estimate the value of the solution at t=1/4.
The slope is F(t,y)=2(1−y). The start is t0=0, y0=2.
h=41, one step: from t=0 to t=41.
The slope is negative, so y decreases.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 2 | −2 | 23 |
F(0,2)=2(1−2)=−2. So y1=2+41(−2)=2−21=23.
The last column uses yn+1=yn+h⋅F(tn,yn).
Past final · Dec 2016 · MATH 100B · Question 10 · 3 marks
Consider the differential equation dtdy=1−2y with initial condition y(0)=2. Use Euler's Method with a single step of size h=Δt=81 to estimate the value of the solution at t=81.
The slope is F(t,y)=1−2y. The start is t0=0, y0=2.
h=81, one step: from t=0 to t=81.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 2 | −3 | 813 |
F(0,2)=1−2(2)=−3. So y1=2+81(−3)=816−83=813.
The last column uses yn+1=yn+h⋅F(tn,yn).
6 questions, 4 from past finals
What it looks like
The question asks for y two or more steps away. It gives the step size, or only the number of steps.
What to do
If you have only the number of steps, find the step size first: h=number of stepsend−start. Then fill one row of the table for each step. If the slope has t in it, move t on by h in every row.
Past final · Dec 2006 · MATH 100B · Question 7(d) · 3 marks
Using Euler's method to solve the differential equation y′=y2 with y(0)=2 and step size 0.1, what is the approximate value of y(0.2)? The answer should be given to at least 3 decimal places.
Here y′ means dtdy. The slope is F(t,y)=y2. The start is t0=0, y0=2.
Each step moves t by 0.1. From t=0 to t=0.2 is 0.10.2−0=2 steps.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 2 | 4 | 2.4 |
| 1 | 0.1 | 2.4 | 5.76 | 2.976 |
F(0,2)=22=4. So y1=2+0.1(4)=2+0.4=2.4.
F(0.1,2.4)=2.42=5.76 (because 242=576). So y2=2.4+0.1(5.76)=2.4+0.576=2.976.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
Past final · Dec 2009 · MATH 100B · Question 2(b) · 6 marks
Consider the differential equation dtdy=y2+1y2−1 with the initial condition y(0)=0. Use two steps of Euler's method to find an approximate value for y(1).
The slope is F(t,y)=y2+1y2−1. The start is t0=0, y0=0.
Two steps from t=0 to t=1: h=21−0=21.
In the second row you divide a fraction by a fraction: flip the bottom one and multiply. 5/4−3/4=−43⋅54=−53.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 0 | −1 | −21 |
| 1 | 21 | −21 | −53 | −54 |
F(0,0)=02+102−1=−1. So y1=0+21(−1)=−21.
Here y12=41. So F(21,−21)=41+141−1=45−43=−53. So y2=−21+21(−53)=−105−103=−108=−54.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
Past final · Dec 2010 · MATH 100B · Question 10(c) · 3 marks
Consider the differential equation dtdx=1+x29x−x3. Use two steps of Euler's method to find a numerical approximation to x(0.5) for the solution with x(0)=1.
Here the unknown function is called x, not y, and time is still t. Nothing else changes. The slope is F(t,x)=1+x29x−x3, and the start is t0=0, x0=1.
Two steps from t=0 to t=0.5: h=20.5−0=41.
n step | tn time | xn value | F(tn,xn) slope | xn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 1 | 4 | 2 |
| 1 | 41 | 2 | 2 | 25 |
F(0,1)=1+129(1)−13=28=4. So x1=1+41(4)=1+1=2.
F(41,2)=1+229(2)−23=518−8=510=2. So x2=2+41(2)=2+21=25.
The last column uses xn+1=xn+h⋅F(tn,xn). After each row the time moves on by h, and the new x at the end of a row is the x at the start of the next row.
Past final · Dec 2011 · MATH 100B · Question 2(b)(iii) · 2 marks
Using Euler's method, determine y1,y2,y3 for y0=1 and Δt=21, for the differential equation dtdy=3y−y2.
The slope is F(t,y)=3y−y2. The question gives no starting time, so call it t0=0. The slope has no t in it, so the times do not change any number here.
h=Δt=21, and three steps, for y1, y2 and y3.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 1 | 2 | 2 |
| 1 | 21 | 2 | 2 | 3 |
| 2 | 1 | 3 | 0 | 3 |
F(0,1)=3(1)−12=2. So y1=1+21(2)=2.
F(21,2)=3(2)−22=6−4=2. So y2=2+21(2)=3.
F(1,3)=3(3)−32=9−9=0. So y3=3+21(0)=3.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
Euler's numbers reach 3 here. There the slope is 0, so they stay at 3. The reason: 3y−y2=y(3−y) is 0 at y=3. The height y=3 is a steady state: a row of flat segments in the slope field. The true solution only gets closer and closer to 3. It never reaches it.
New problem
Use Euler's method with step size h=21 to estimate y(1) for dtdy=2t−y, y(0)=1.
The slope is F(t,y)=2t−y. It has both t and y in it. The start is t0=0, y0=1.
h=21. From t=0 to t=1 is 1/21−0=2 steps.
In each row put that row's t into the slope. A common mistake is to keep t=0 in every row.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 1 | −1 | 21 |
| 1 | 21 | 21 | 21 | 43 |
F(0,1)=2(0)−1=−1. So y1=1+21(−1)=21.
The time moves on: t1=0+21=21. F(21,21)=2(21)−21=1−21=21. So y2=21+21(21)=21+41=43.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
New problem
Let y(t) be the solution of dtdy=ty with y(1)=2. Use Euler's method with two steps to estimate y(0).
The slope is F(t,y)=ty. The start is t0=1, y0=2.
We go from t=1 back to t=0 in two steps: h=20−1=−21. The step size is negative when you go back in time. The formula does not change.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 1 | 2 | 2 | 1 |
| 1 | 21 | 1 | 21 | 43 |
F(1,2)=(1)(2)=2. So y1=2+(−21)(2)=2−1=1.
The time moves back: t1=1−21=21. F(21,1)=21(1)=21. So y2=1+(−21)(21)=1−41=43.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
2 questions
What it looks like
The question asks if the Euler estimate is larger or smaller than the true value: an overestimate or an underestimate.
What to do
Find out if the solution is concave up or concave down on the steps you took. Concave up: the tangent lines are below the curve, so Euler is too small. Concave down: they are above it, so Euler is too big. To find the concavity, find y′′: differentiate the equation once more.
New problem
Use Euler's method with two steps to estimate y(1) for dtdy=y+1, y(0)=0. Is your estimate larger or smaller than the true value?
The slope is F(t,y)=y+1. The start is t0=0, y0=0. Two steps from t=0 to t=1: h=21−0=21.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 21 |
| 1 | 21 | 21 | 23 | 45 |
F(0,0)=0+1=1. So y1=0+21(1)=21.
F(21,21)=21+1=23. So y2=21+21(23)=42+43=45.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
Here y′ means dtdy, and y′′ is the derivative of y′. Differentiate both sides of y′=y+1 with respect to t. The left side gives y′′. On the right side, y gives y′ and the constant 1 gives 0. So y′′=y′, and y′=y+1:
y′′=y+1.
The solution starts at y=0, and its slope y+1 is positive there. So y increases and stays above 0. Then y′′=y+1>0: the solution is concave up the whole time.
A concave-up curve is above its tangent lines. Euler's method follows tangent lines, so it ends below the curve. The estimate 45 is too small: an underestimate.
New problem
Use Euler's method with step size h=21 to estimate y(1) for dtdy=3−y, y(0)=1. Is your estimate an overestimate or an underestimate? Explain.
The slope is F(t,y)=3−y. The start is t0=0, y0=1. Each step moves t by 21, so from t=0 to t=1 is two steps.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 1 | 2 | 2 |
| 1 | 21 | 2 | 1 | 25 |
F(0,1)=3−1=2. So y1=1+21(2)=2.
F(21,2)=3−2=1. So y2=2+21(1)=25.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
Here y′ means dtdy, and y′′ is the derivative of y′. Differentiate y′=3−y with respect to t. The constant 3 gives 0, and −y gives −y′. So
y′′=−y′=−(3−y)=y−3.
The solution starts at 1 and increases toward 3, but it never reaches 3 (y=3 is a steady state). So y<3, and y′′=y−3<0: the solution is concave down.
A concave-down curve is below its tangent lines, so each Euler step ends above the curve. The estimate 25 is too big: an overestimate.
2 questions
What it looks like
The question shows a slope field, or asks you to sketch a solution, read a value from your sketch, or explain why an Euler answer does not match the sketch. The newest finals ask all of these in one question.
What to do
Find the flat rows first: the heights where dtdy=0 for every t. They are steady states, and a solution never crosses them. Sketch by following the little segments. Then do Euler's table, and compare its numbers with your sketch.
New problem
In this question we look at the differential equation dtdy=2y(3−y).
(a) Use the slope field below to sketch the solution with y(0)=2, from t=0 to t=3.
(b) From your sketch, estimate y(1).
(c) Use Euler's method with two steps to approximate y(1).
(d) Is your answer to (c) larger or smaller than the true value of y(1)? Explain.
2y(3−y)=0 when y=0 or y=3. These are the rows of flat segments: the steady states. Between them the slope is positive. So a solution that starts at y=2 increases, but it can never cross y=3.
Start at the dot (0,2) and follow the segments. The curve increases. It becomes flatter and flatter as it gets close to y=3, and it never touches 3.
Go up from t=1 to the curve, then across to the y-axis: about 2.7. A reading close to that is fine. A sketch is not exact.
Two steps from t=0 to t=1: h=21−0=21.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 2 | 1 | 25 |
| 1 | 21 | 25 | 85 | 1645 |
F(0,2)=22(3−2)=22=1. So y1=2+21(1)=25.
Here 3−y1=3−25=21. So F(21,25)=225⋅21=45⋅21=85. So y2=25+21(85)=1640+165=1645.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
Here y′ means dtdy. Write F(y)=23y−y2, so F′(y)=23−2y. By the chain rule,
y′′=F′(y)⋅y′=23−2y⋅y′.
On the steps we took, 2≤y<3. Then 3−2y<0 and y′>0, so y′′<0: concave down. You can see it in the slope field too: as y increases toward 3, the segments become flatter.
Concave down means the tangent lines are above the curve, so Euler's steps end above it. 1645 is larger than the true y(1). This agrees with the sketch: 1645 is more than 1644=2.75, so it is above the 2.7 from the sketch.
New problem
Consider dtdy=−4y with y(0)=1.
(a) Use Euler's method with step size h=21 to find y1, y2 and y3.
(b) The true solution is y=e−4t. Can the numbers in (a) be right? Explain.
(c) Do (a) again with step size h=101, for y1 and y2.
The slope is F(t,y)=−4y, the start is t0=0, y0=1, and h=21. Three steps, for y1, y2 and y3.
n step | tn time | yn value | F(tn,yn) slope | yn+1 next value |
|---|---|---|---|---|
| 0 | 0 | 1 | −4 | −1 |
| 1 | 21 | −1 | 4 | 1 |
| 2 | 1 | 1 | −4 | −1 |
F(0,1)=−4(1)=−4. So y1=1+21(−4)=1−2=−1.
F(21,−1)=−4(−1)=4. So y2=−1+21(4)=−1+2=1.
y is 1 again, so this row is the same as the first row: y3=−1.
The last column uses yn+1=yn+h⋅F(tn,yn). After each row the time moves on by h, and the new y at the end of a row is the y at the start of the next row.
y=0 is a steady state, because −4y=0 there. The true solution e−4t is always positive. It decreases toward 0 and never reaches it.
But Euler's values go from 1 to −1, across the steady state. Then they go back and forth: 1,−1,1,−1,… These numbers cannot be right.
Euler's method uses the slope at the start of a step for the whole step. Here the slope at y=1 is −4. Half a unit of time at that slope decreases y by 2. The true solution becomes flat much sooner. The step is too big.
Now h=101. The slope at y0=1 is −4, so y1=1+101(−4)=1−52=53.
The slope at y1=53 is −4⋅53=−512, so y2=53+101(−512)=2515−256=259.
These stay positive and decrease toward 0, like the true solution. Smaller steps give a better answer.
New problems every time, with numbers that work on paper
Solve each problem on paper first, with no calculator. Then type your numbers into the table, one row at a time. Every box is checked: 9/4, 2.25 and 18/8 are all right. If you cannot continue, open a hint, or show one box. In Your own question you can type any function from your homework and see the whole table.
More of the same kind: related rates and optimization, every type of problem. One recipe per kind of question: the Math 100 Problem Playbook.
