Secant method:
Evaluating this formula means, the first approximation x0 multiplied by the function of the second approximation x1, minus the function of the first approximation x0 multiplied by the second approximation x1. This is then divided by the function of the second approximation minus the function of the first approximation to give the third approximation.
I can use this method because my x(0) is equal to π/2, and x(1) is equal to 0; hence if we were to substitute these values into the formula described above we would have an approximation of the root closer to the real root X(3), then I would use x(2) and x(3). The secant method always uses the two most recent approximations of the root. I will produce an answer to 9 significant figures by the use of excel; I should be able to produce a formula on excel for the secant method thus making this method suitable for this equation.
False position method:
The false position method is similar to the secant method in the sense that it uses a straight line to approximate the function of the area of interest. The difference between the two methods is that the secant method uses two approximations which are the most recent approximations of the root. The false position method also uses two approximations; it uses the most recent approximation of the root and the most recent root which has the opposite sign of the most recent approximation of the root.
False position method:
Evaluating this formula, lets assume f(a) = -2 and f (b) = 10, lets assume
C = 3, however the f(c) = -5, this means for the new equation would involve b and a would be replaced by c. This means for the false position method to work, the two approximations of the root used in the formula, their functions would have to be opposites. Hence unlike the secant method, we would use the most recent approximation and the most recent opposite signed approximation’s function. Other than that we treat it the same way as the secant method.
For my equation, x + ktanx – 1 =0, I will use a as 0, because f(a) = -1, I will use b as π/4 because f(b) = positive, hence the false position method will work. However to carry out multiple iterations I will have to create a spreadsheet, which can be done for the false position method. So therefore it is a suitable method for the equation.
Use of technology:
Use of software:
I had two options in terms of what technology to use in order to solve this equation, it was either to use a calculator or excel. In the end I chose excel for multiple reasons which include:
A calculator is only accurate to 8 D.P because of its display screen, however excel is accurate to 15 D.P. My calculation was done to 9 D.P. This is because I felt it 9D.P would be close to the real root and it would still be neat and easy to understand.
Furthermore on excel all you need is the formula, once you’ve created this that’s all you need. For example we can change the value of K and the formula would take this into account and would calculate the new root accordingly. While with a calculator we would have to start from scratch.
Finally to carry out iterations on excel is extremely easy, all you have to do is drag the cell down in order to copy the formula over and excel will automatically convert the formula for the new cell. If I was to do this on a calculator, fixed point iteration would be fine as all you would have to do is continuously press the = as it is a recurrence relation. However to use a calculator for the method of bisection, would be very tedious as you would have to manually input a different values every iteration, this would also increase the chance of a mistake.
Finally in order to make sure my approximation is correct I also made use of software called autograph. This piece of software allowed me to generate a graph of the equation y=+ tanx – 1, I could then compare my approximation of the root which the one autograph provided.
Formula application:
For my spreadsheets to work I had to create a formula for;
- The method of bisection
- Secant method
- False position method
- Fixed point iteration
I used multiple formulas in order to satisfy the methods, for more information on the formulas read the sections below where it deeply talks about them and how they were created.
Solution to the problem:
Method of bisection:
To use the method of bisection, we must rearrange the equation so it = 0. Hence the equation, x +ktanx = 1, turns into, x + ktanx – 1 = 0, this is our function (f). As explained earlier the method of bisection requires an interval which supports the sign change argument. This means that the f(a) must equal negative and f(b) must be positive. In the question we are provided with an interval which is 0 < x < π/2.
Lets assume K = 1
F(0) = -1
F(π/2) = a very large positive number.
Our current interval is 0 < x < π/2, in order to get a better approximation we must find the midpoint of the interval (h), and do the f(h).
0 + π/2 / 2 = π/4
F(π/4) = 0.785398163.
Since f(h) is positive we replace this value with the positive value in our original interval, hence our interval now becomes 0 < x < π/4. However it isn’t feasible to continue doing this until we get an answer that doesn’t change to 9 sig figures by hand, and then doing it all again for different values of K, hence we create a spreadsheet.
Formulas used:
Fixed point iteration:
To use fixed point iteration we need to rearrange the equation so that it equals x. There are two possible rearranged forms are:
- X= 1 – ktanx
- X= arctan(1-x)/k
Fixed point iteration uses recurrence relation so by finding the answer of one iteration we produce X(1), we then use X(1) as x in the formula to produce X(2), this is how we get closer to the root by using this method.
For example the first iteration for x = 1 – ktanx assuming that k = 1 is:
X = 1 – tan(π/4)
The value of tan(π/4) = 1
1-1 = 0, hence the value of the first iteration is 0, for the second iteration we would do:
X = 1 – tan(0)
The value of tan(0) = 0
1-0 = 1 hence the value of the second iteration is 1 and we would carry on. This task can be tedious to carry on doing it again and again especially for different values of K and if it has a lot of iterations, hence we use a spreadsheet.
Formulas used for spreadsheet:
Secant method:
The secant method requires two approximations of the root in order to work. Fortunately we’ve been provided with two roots, 0 and π/2. We can now call x(0) as π/2 and x(1) as 0, we can then substitute these values into the following equation.
Formula used for spreadsheet:
False position method:
Similar to the secant method, the false position method also requires two
approximations of the root. I will use one root a as 0 and the other root b as π/4. Bearing this in mind we can substitute the values into the formula:
The formula is the same as the secant method however remember the false position method roots approximation must support the sign change argument.
Formula used for spreadsheet:
Proof of root:
Another way to check the root is to check the upper and lower bounds of the interval in which my root lies in. The interval in which the root has to lie in is, 0.4797310065 < x < 0.4797310075 (this is due to the error being ± 0.0000000005, as explained later) . If we therefore do the function of the upper and lower bounds, where the function is, y=x+tanx-1, if the root is a correct approximation one function will be negative and the other positive.
f(0.4797310075)= 0.0000000005
f(0.4797310065)= -0.0000000018
Therefore this interval obeys the change in sign law, the fact that the upper bounds and lower are two opposite signs the root must lie within the range of values of the interval.
As K varies
As we proved above, if K = 1 the root is 0.479731007. However what if K, was 2, 3 etc, could a pattern be distinguished, the following results are positive integers of the variable K:
The relationship between the positive integer K, and its respective root α is:
As k-> ∞ then α -> 0
In other words as the value of K increases, the value of α(the root) decreases. The graph appears to have some form of geometric progression if we look at the graph. In order for it to be a geometric progression it must have a common multiple. Assuming it does we will be able to approximate the root for another value of K. It will only be a approximation as the value of our roots are approximations.
To prove that there is a common factor, C we do the following: (assume k=(k+1) and F=(K+2))
C= F/K Thus C = 0.678176364
Assuming c = common factor, then α at k =4 x C will equal α when K = 5.
0.197900255 x 0.678176364 = 0.134211275
0.134211275 ≠ 0.165395943, therefore this isn’t a geometric progression.
I have now tested positive integers of K however what about negative integers of K, will it have the same relationship or the opposite relationship, here are the values of negative integers of K:
The relationship between the negative integer K and the root α is:
As k-> -∞ then α -> 0
Essentially this means that there is a positive correlation, as the value of K increases the value of α increases. Something to consider is that with the inclusion of a negative sign all of my roots have been removed from the range I have been investigating. Therefore we can say that the inclusion of a negative sign results in the root being moved into the negative direction.
So far we’ve only seen K as an integer, how about when it isn’t an integer, what will the correlation now be, here’s a table with values of K when it isn’t an integer.
There are two relationships which this graph shows:
Assuming α is +ve, as k -> ∞, α -> 0
Assuming α is -ve , as k -> -∞, α -> 0
To simplify if K is a positive number then it has a negative correlation, however if K is a negative number then it has a positive correlation. As proved above there is no geometric progression either.
The best method:
One way to conclude which is the best method is to find out the problems in each of the formula. The secant method does not require two approximations of the root to be used which are of opposite signs, unlike method of bisection and method of false position; as a result secant method may not always converge.
However to carry on this way is impractical and doesn’t relate to my problem, the best method may not be the best for my investigation. Therefore the only way to conclude the best method is to look at the amount of iterations used, the rate of convergence.
Rate of convergence:
Rate of convergence is the speed at which a converging sequence of numbers approaches its final answer. So therefore the higher the rate of convergence the quicker the method reaches the final approximation.
First order of convergence:
The formula to work out the first order of convergence is:
Absolute error in x1 / Absolute error in x2
In order to find absolute error, we usually do (x(approximation) – α(root), provided the root is smaller than the approximation. However in this investigation this is impossible as the root, α, is unknown.
However it is true that the absolute error represented by ε approximately obeys the following equation.
X2-x1/ = kε – kε^2/ = kε(1-k)/ Therefore everything cancels out
X1-x0 ε – kε ε(1-k) except for K, this is known as the ratio of differences and can be used to find the first order of convergence is α is unknown, for example in my case.
To summarize:
X2- x1/ ≈ K a constant which shows the common multiple of how much the
X1 – x0 absolute error is increasing by.
Secant method:
If we apply the first order of convergence principles to this method we get the following:
This works out the first order convergence for the secant method, this should give us the constant K if it is first order convergence, sadly it doesn’t. The final(green) values should all be approximately the same. However they clearly are not, this means the secant method does not have first order convergence.
False position method:
If we apply the first order of convergence principles to this method we get the following:
Once again the last value isn’t remotely close to a K, granted that the false position method’s first order convergence has a smaller range of K than secant method did. This will be significant later. However from this we can conclude that the false position method does not have a first order convergence.
Method of bisection:
If we apply the first order of convergence principles to this method we get the following:
Unlike the secant and false position method, the method of bisection has a constant value of K, 0.5. One thing to note is the amount of iterations for the bisection method compared to secant and false position, bisection has a lot more iterations. As a result the value of K is a constant when the first order of convergence is used.
Fixed point iteration:
If we apply the first order of convergence principles to this method we get the following:
The first order of convergence for fixed point iterations remains relatively constant, this value is 0.786 however, bear in mind that the amount of iterations used here is once again loads relative to secant and method of false position.
Second order of convergence:
In order to find the first order of convergence
Errors:
To begin with I will look at a graph of the approximation of the root compared to real value of the root.
If we look at this graph we can be certain that our answer is merely an approximation. If we look at my approximation, it is correct to 9 D.P because of repeat iterations however a better answer would be to write it in terms of error bounds, upper and lower bounds.
0.4797310065 < x < 0.4797310075, to test the bounds are correct we can do the f of both of these values and it would have to support the sign change argument, as proved above.
This means the root is 0.479731007 ± 0.0000000005. We can however lower the boundaries and thereby create a better approximation of the root. In order to lower the boundaries we merely continue reducing/increasing them until we hit the boundary of sign changes.
f(0.4797310073) = 0.0000000000444833
f(0.4797310072= -0.0000000002
Conclusion
The root to the equation is, 0.4797310065 < x < 0.4797310075 hence 0.479731007 to 9 D.P.
This is my approximation of the root compared to the actual root, bear in mind this is zoomed in by a lot. However how valid is this approximation of the root?
If we look back we found out there were problems with the formulas themselves however that was merely for the purpose of finding the best method, this cannot be used as a limitation because it doesn’t apply to this equation.
However earlier I did mention that excel is accurate to 15 D.P, my answer is only valid to 9 D.P, this is definitely a limitation, if I had more time I would change my figures and calculate it to 15 D.P.
Another way to test its validity we merely insert it back into the original equation,
x + tanx – 1 =0. Notice the =0 part, if this approximation is valid then by using our approximation (x) in this equation we should end up with an answer close to 0. The result of the equation is -6.37 x 10^-10. Notice the degree of the polynomial is a high minus number meaning this number is tiny and extremely close to 0. This means my approximation of the root is valid. In order to improve on this approximation we could find the root to more D.P as explained earlier.