0% found this document useful (0 votes)
3 views

Numerical Methods

The document provides a cheat sheet on numerical methods, specifically focusing on the Newton-Raphson method for finding roots of equations. It explains the iterative process, the importance of choosing appropriate starting values, and discusses convergence and divergence of the method. Additionally, it includes examples and applications of the method in real-life scenarios, emphasizing the significance of changes in sign and the presence of multiple roots.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Numerical Methods

The document provides a cheat sheet on numerical methods, specifically focusing on the Newton-Raphson method for finding roots of equations. It explains the iterative process, the importance of choosing appropriate starting values, and discusses convergence and divergence of the method. Additionally, it includes examples and applications of the method in real-life scenarios, emphasizing the significance of changes in sign and the presence of multiple roots.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Pure Year 2

Numerical Methods Cheat Sheet Newton-Raphson method


Some mathematical equations that form in the real world turn out to be very difficult to solve; finding an
exact solution is either very time consuming or impossible using techniques we already know. Take for Another method to find the roots of an equation 𝑓(𝑥) = 0 is to use the Newton-Raphson method. The Newton-Raphson formula
Using iteration is:
example, the equation 3𝑙𝑛|2𝑥 2 | + 4𝑐𝑜𝑠𝑥 − 𝑒 𝑥 = 0. This cannot be solved using any techniques you have If we wish to find the roots of an equation 𝑓(𝑥) = 0, we can use an iterative method.
learnt so far. We can instead use numerical methods to find approximations to the solutions of such
𝑓(𝑥 )
equations. ▪ 𝑥𝑛+1 = 𝑥𝑛 − 𝑓 ′ (𝑥𝑛 )
1. To solve an equation of the form 𝑓(𝑥) = 0, rearrange the equation into the form 𝑥 = 𝑔(𝑥) and use the 𝑛
iterative formula 𝑥𝑛+1 = 𝑔(𝑥𝑛 ).
Locating roots This method uses tangent lines to find accurate approximations of roots. The starting values must be chosen carefully with th e
A root of a function is a value of 𝑥 for which 𝑓(𝑥) = 0. In other words, a root is where 𝑓(𝑥) crosses the Newton-Raphson method. Usually this will be given to you, but if not then you need to consider the following two points:
You must be careful when using an iterative method as not all iterations will converge to a root. Sometimes, successive
𝑥-axis. iterations will move away from the root quickly. This is known as divergence.
▪ If the starting value, 𝑥0, is near a turning point then the method can converge on a root quite slowly, as the tangent
▪ If 𝑓(𝑥) is continuous on the interval [𝑎, 𝑏] and 𝑓(𝑎) has an opposite sign to 𝑓(𝑏), then 𝑓(𝑥) has at line will be far from the 𝑥-axis.
Example 2: 𝑓(𝑥) = 𝑥 3 − 3𝑥 2 − 2𝑥 + 5
least one root in this interval. a) Show that 𝑓(𝑥) = 0 has a root 𝛼 in the interval 3 < 𝑥 < 4,
𝑥3 −2𝑥+5 ▪ If the starting value, 𝑥0, is at a turning point then the method will fail completely as the formula would result in division
When we say 𝑓(𝑥) has to be continuous on an interval, this just means that when graphed, the function is b) Show that the equation 𝑓(𝑥) = 0 can be written as 𝑥 = ට .
3 by 0, which is undefined.
unbroken. In other words, you could trace the function with a pen without needing to lift your pen off the c) Use the iterative formula 𝑥𝑛+1 = 𝑔(𝑥𝑛 ) to find the value of 𝑥1, 𝑥2 and 𝑥3, with (i) with 𝑥0 = 1.5, (ii) with 𝑥0 = 4.
paper.
a) We must calculate 𝑓(3) and 𝑓(4) and show that there is 𝑓(3) = 33 − 3(32 ) − 2(3) + 5 = −1
a change in sign. 𝑓(4) = 43 − 3(42 ) − 2(4) + 5 = 13 The two graphs below illustrate each of the above cases:
Let’s look at an example to clarify why the above bullet point makes sense:
As there is a change in sign between 𝑥 = 3 and 𝑥 = 4,
this proves that a root lies in this interval. Slow convergence Failure
Example 1: Show, without using the graph, that the function 𝑦 = 𝑠𝑖𝑛𝑥 + 𝑥 4 − 𝑙𝑛𝑥 − 5𝑥 the starting point is near a turning point, so the tangent line the starting value is at a turning point, so the
b) With such questions, the clue is in what you want to 𝑓(𝑥) = 0 ⇒ 𝑥 3 − 3𝑥 2 − 2𝑥 + 5 = 0 cuts the 𝑥 axis far from the root. tangent never cuts the 𝑥-axis.
has a root 𝛼 in the interval [1, 2].
show. The expression is square rooted, which tells us we
want to first make 𝑥 2 the subject.
Calculating 𝑓(1): 𝑠𝑖𝑛1 + 14 − 𝑙𝑛1 − 5 = −3.1585 …
Calculating 𝑓(2): 𝑠𝑖𝑛2 + 24 − 𝑙𝑛2 − 5(2) = 6.216 … Making 𝑥 2 the subject. ⇒ 3𝑥 2 = 𝑥 3 − 2𝑥 + 5
We can see a change of sign occurs between 𝑥 = 1 and 𝑥 = 2. 𝑥 3 − 2𝑥 + 5
⇒ 𝑥2 =
3
This means that somewhere between 𝑥 = 1 and 𝑥 = 2, the function crosses the Square rooting:
𝑥-axis. Hence, a root must lie in the mentioned interval. 𝑥 3 − 2𝑥 + 5
∴𝑥=ඨ
3
This is confirmed by the graph, which clearly shows the curve crossing the 𝑥-axis 𝑥𝑛 3 −2𝑥𝑛 +5
c) The iterative formula we need to use is 𝑥𝑛+1 = ට .
in the same interval. 3
(𝑖) 𝑥0 = 1.5 (𝑖𝑖) 𝑥0 = 4
𝜋 𝜋
Example 4: 𝑓(𝑥) = 2𝑠𝑒𝑐𝑥 + 2𝑥 − 3, − < 𝑥 < where x is in radians.
2 2
1.53 −2(1.5)+5 4 3 −2(4)+5
𝑥1 = ට = 1.3385.. 𝑥1 = ට = 4.5092.. Given that 𝑓(𝑥) = 0 has a solution, 𝛼, in the interval 0.4 < 𝑥 < 0.5, take 0.4 as a first approximation to 𝛼 and apply the
3 3
Changes of sign and roots Newton-Raphson procedure to obtain a second approximation. Give your answer to 3 decimal places.
1.3385..3 −2(1.3385..)+5 4.50923 −2(4.5092)+5
If there isn’t a change of sign in an interval, that does not necessarily mean a root does not exist. Also, if there 𝑥2 = ට = 1.2544.. 𝑥2 = ට = 5.4058..
3 3
We start by finding 𝑓′(𝑥), then 𝑓 ′(𝑥) = 2𝑠𝑒𝑐𝑥𝑡𝑎𝑛𝑥 + 2 ⇒ 𝑓 ′(0.4) = 2 sec(0.4) tan(0.4) + 2 = 2.9181..
is a change of sign, that does not necessarily mean only one root exists. There are three cases you need to be 1.2544..3 −2(1.2544..)+5 5.4058..3 −2(5.4058..)+5 substituting 𝑥 = 0.4 into 𝑓′(𝑥) and 𝑓(𝑥). 𝑓(0.4) = 2 sec(0.4) + 2(0.4) − 3 = −0.02859..
wary of: 𝑥3 = ට = 1.2200.. 𝑥3 = ට = 7.1219..
3 3 −0.02859..
Now using the Newton-Raphson formula: 𝑥2 = 0.4 − = 0.4098. . = 0.410 to 3 decimal places.
2.9181..
As you can see, when we used 𝑥0 = 1.5, our iterations slowly converged. With 𝑥0 = 4 however, each successive iteration
moved further away, indicating divergence. This shows the effect that an unsuitable starting value can have.
Case 1: Multiple roots with no sign change
If there is more than one root in an interval, 𝑓(𝑎) Applications to modelling
and 𝑓(𝑏) may have the same sign. There are two ways in which an iteration can converge: You also need to be able to apply your knowledge of numerical methods to questions involving models of real-life scenarios.

Way 1: Successive iterations get closer to the root, Example 5: The future world ranking position of a tennis player during a calendar year can be modelled by the function.
Here, there are two roots between 𝑎 and 𝑏 but approaching the root from the same direction. This 1 7
𝑤(𝑥) = − 𝑥 4 + 𝑥 3 − 7𝑥 2 + 17𝑥 + 40, 0 ≤ 𝑥 ≤ 12
𝑓(𝑎) and 𝑓(𝑏) are both negative. is graphically represented by a “staircase” diagram. 50 10

where 𝑥 is the number of months since the beginning of the year.

Case 2: Multiple roots with a sign change The diagram shows the graph with equation 𝑦 = 𝑤(𝑥). The graph has a local
There can be more than one root present if there is a maximum at 𝐴 and local minimum at 𝐵.
change in sign.
Way 2: Successive iterations alternate between being
above and below the root. This is graphically represented
by a “cobweb” diagram. a) Find 𝑤 ′ (𝑥).
There are three roots between 𝑎 and 𝑏 and 𝑓(𝑎) b) Show that the player reaches a minimum ranking between 8.3 and 8.4 months after the beginning of the year.
and 𝑓(𝑏) have opposing signs. 10 2
c) Show that the turning points of the graph correspond to the equation 𝑥 = ±ට21 ቀ25 𝑥 3 + 14𝑥 − 17ቁ.

a) We use the formula to find the first few 4 3 21 2


𝑤 ′(𝑥) = − 𝑥 + 𝑥 − 14𝑥 + 17
Case 3: Vertical asymptotes iterations. 50 10
When vertical asymptotes are present, a sign change Example 3: Figure 1 shows the graph of 𝑦 = 2 ln(8 − 𝑥) and the graph of Figure 1
will occur without there being any root. b) We want to show there is a turning point 4 21
𝑦 = 𝑥. These curves meet at a single point, 𝑥 = 𝛼. A student uses the iteration 𝑤 ′(8.3) = − (8.3)3 + (8.3)2 − 14(8.3) + 17 = −0.27396
formula 𝑥𝑛+1 = 2 ln(8 − 𝑥𝑛 ) in an attempt to find an approximation for 𝛼. Using between 𝑥 = 8.3 and 𝑥 = 8.4. This means we 50 10
want to show 𝑤 ′(𝑥) = 0 has a root 𝛼 in the 4 21
the graph and starting with 𝑥1 = 4, determine whether or not this iteration formula 𝑤 ′(8.4) = − (8.4)3 + (8.4)2 − 14(8.4) + 17 = 0.15968
interval (8.3, 8.4). Using the technique from 50 10
can be used to find an approximation for 𝛼. There is a change in sign between 𝑥 = 8.3 and 𝑥 = 8.4 so a root
The graph never crosses the 𝑥 axis yet 𝑓(𝑎) and example 1:
𝑓(𝑏) have opposing signs. must lie in this interval, which means that the player reaches a
minimum ranking between 8.3 and 8.4 months. We know the point
We use the formula to find the first few iterations. 𝑥1 = 2 ln(8 − 4) = 2𝑙𝑛4 = 2.773 … is a minimum since the graph only has a minimum in this range.
𝑥2 = 2 ln(8 − 2𝑙𝑛4) = 3.308 … 4 21
c)
𝑥3 = 2 ln(8 − 2𝑙𝑛4) = 3.092 … 𝑤 ′(𝑥) = − 𝑥 3 + 𝑥 2 − 14𝑥 + 17 = 0
50 10
Now we represent these iterations on the diagram: 21 2 2 3
𝑥 = 𝑥 + 14𝑥 − 17
10 25
We can see that a cobweb diagram is formed. Each
10 2 3
iteration gets closer and closer to the root which 𝑥2 = ൬ 𝑥 + 14𝑥 − 17൰
21 25
indicates convergence.
10 2 3
𝑥 = ±ඨ ൬ 𝑥 + 14𝑥 − 17൰
Stating why our diagram means the iteration formula Since successive iterations form a cobweb diagram, the formula 21 25
is suitable. does indeed converge to the root 𝛼, so it is suitable.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc

You might also like