• Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month
Page
  1. 1
    1
  2. 2
    2
  3. 3
    3
  4. 4
    4
  5. 5
    5
  6. 6
    6
  7. 7
    7
  8. 8
    8
  9. 9
    9
  10. 10
    10
  11. 11
    11
  12. 12
    12
  13. 13
    13
  14. 14
    14
  15. 15
    15
  16. 16
    16
  17. 17
    17
  18. 18
    18
  19. 19
    19
  20. 20
    20
  21. 21
    21
  22. 22
    22
  23. 23
    23
  24. 24
    24

Functions Coursework - A2 Maths

Extracts from this document...

Introduction

C3 Coursework: Numerical Analysis

Change of sign method

I want to find the roots of the equation x3-3x-1=0 to five decimal places.

Consider the function f(x)=x3-3x-1; hence I want to find the roots of the equation f(x)=0.

If the function is continuous in the interval [a,b], where a and b are values x could take, and either:

f(a)<0 and f(b)>0

or:

f(a)>0 and f(b)<0

then there must be at least one root of the equation f(x)=0 in the interval [a,b]. Therefore we are looking for a change of sign, which will then indicate the interval in which there lies a root of the equation f(x)=0.

The table shows values of f(x) at integer values of x from -5 to 5.

x

-5

-4

-3

-2

-1

0

1

2

3

4

5

f(x)

-111

-53

-19

-3

1

-1

-3

1

17

51

109

We can identify 3 intervals which have a change of sign:

[-2,-1],[-1,0] and [1,2]

If we sketch the graph of the function, i.e. y=f(x), the x values at the point where y=0 are the roots to the equation f(x)=0, since y=f(x). Three roots are confirmed in these intervals i.e. each interval contains one root.

image00.png

The gradient formula can be calculated: f′(x)=3x2-3

f′(5)=72, and after x=5, the gradient formula shows that the gradient just continues to increase with increasing x therefore the curve y=f(x) never crosses the x-axis after x=5.

f′(-5)=72, and for any x value lower than x=-5, the gradient formula shows that the gradient just continues to increase with decreasing x, therefore the curve y=f(x) never crosses the x-axis before x=-5.

Therefore there are no roots of the equation f(x)

...read more.

Middle

As one can see, x1 which equals 2, is more accurate than x2 which equals four. The root the iteration converges to is 2.8951065. This occurs because the absolute value of the gradient formed at the curve is very small, i.e. it is very shallow, therefore the tangent touches the x-axis further away. However, this method still works because the tangent formed at (2,-10) leads the iteration to (4,0), allowing tangent sliding from the right side of the curve, which brings us back to a similar situation.


I can confirm earlier that I had found the roots using this method to seven decimal places. I had claimed that the roots to the equation x3-7x-4=0 are:

x= 2.8951065, -0.6027049, -2.2924016 (all to seven decimal places)

Primarily Excel gave 8 figures after the decimal point, so I could confirm that there would not be a rounding error when giving the roots to seven decimal places. I therefore rounded the values of x to seven decimal places. I can confirm that these are correct to seven decimal places using the decimal search method.

I therefore wish to confirm that x=2.8951065 to seven decimal places is a root of the equation x3-7x-4=0.

x

f(x)

x

f(x)

x

f(x)

X

f(x)

-5

-94

2.0

-10

2.80

-1.648

2.890

-0.09243

-4

-40

2.1

-9.439

2.81

-1.48196

2.891

-0.07437

-3

-10

2.2

-8.752

2.82

-1.31423

2.892

-0.05628

-2

2

2.3

-7.933

2.83

-1.14481

2.893

-0.03818

-1

2

2.4

-6.976

2.84

-0.9737

2.894

-0.02007

0

-4

2.5

-5.875

2.85

-0.80087

2.895

-0.00193

1

-10

2.6

-4.624

2.86

-0.62634

2.896

0.016219

2

-10

2.7

-3.217

2.87

-0.4501

2.897

0.034388

3

2

2.8

-1.648

2.88

-0.27213

2.898

0.052575

4

32

2.9

0.089

2.89

-0.09243

2.899

0.070779

5

86

3.0

2

2.90

0.089

2.90

0.089

x

f(x)

x

f(x)

X

f(x)

x

f(x)

2.8950

-0.00193

2.8951

-0.00012

2.89510

-0.00012

2.8951060

-9.4E-06

2.8951

-0.00012

2.89511

6.32E-05

2.895101

-0.0001

2.8951061

-7.5E-06

2.8952

0.001696

2.89512

0.000245

2.895102

-8.2E-05

2.8951062

-5.7E-06

2.8953

0.003511

2.89513

0.000426

2.895103

-6.4E-05

2.8951063

-3.9E-06

2.8954

0.005326

2.89514

0.000608

2.895104

-4.6E-05

2.8951064

-2.1E-06

2.8955

0.007141

2.89515

0.000789

2.895105

-2.8E-05

2.8951065

-2.9E-07

2.8956

0.008956

2.89516

0.00097

2.895106

-9.4E-06

2.8951066

1.53E-06

2.8957

0.010772

2.89517

0.001152

2.895107

8.78E-06

2.8951067

3.34E-06

2.8958

0.012587

2.89518

0.001333

2.895108

2.69E-05

2.8951068

5.15E-06

2.8959

0.014403

2.89519

0.001515

2.895109

4.51E-05

2.8951069

6.97E-06

2.8960

0.016219

2.89520

0.001696

2.895110

6.32E-05

2.8951070

8.78E-06

x

f(x)

2.89510650

-2.9E-07

2.89510651

-1.1E-07

2.89510652

7.39E-08

2.89510653

2.55E-07

2.89510654

4.37E-07

2.89510655

6.18E-07

2.89510656

8E-07

2.89510657

9.81E-07

2.89510658

1.16E-06

2.89510659

1.34E-06

2.89510660

1.53E-06

Therefore using the decimal search method, the root lies in the interval [2.89510651,2.89510652], therefore to 7 decimal places, it is equal to 2.8951065. Therefore I have confirmed the accuracy to one of the roots the Newton-Raphson method produced.

An example of a failure of this method is as follows:

Suppose I want to find a particular root of the equation x3-4x+1=0. Let f(x)= x3-4x+1 and a graph of y=f(x) is drawn below. image11.png

I want to find the root of the equation in the interval [0,1]. 1 is a decent first approximation, as it is closer to the root near 0, than the root at 2.

However if one uses 1 in the iteration the following occurs:

x1

1.00000000

x2

-1.00000000

x3

3.00000000

x4

2.30434783

x5

1.96748948

x6

1.86947047

x7

1.86087068

x8

1.86080586

x9

1.86080585

x10

1.86080585

i.e. it does not converge at the required root.

To illustrate this graphically (the pink line represents the iteration):

image12.png

This happens because the gradient of the curve at x=1 is very shallow, therefore the tangent touches the x-axis ‘too far’ to the left. The gradient is shallow at this value for x as well, therefore the new tangent touches the x-axis ‘too far’ to the right, causing convergence at the root furthest to the right (the root with the biggest value), 2.8951065. Therefore the method fails to find the particular root I wanted it to find despite taking a starting value close to it.


Rearranging f(x)=0 in the form x=g(x)

I want to find the roots of the equation x3-3x+1=0 to seven decimal places.

Consider the function f(x)=x3-3x+1; hence I want to find the roots of the equation f(x)=0.

One way to rearrange this equation is:

x3+1=3x

therefore x=(x3+1)/3

Therefore one possible iteration that emerges from the original equation is:

xn+1=(xn3+1)/3

Let g(x)=(x3+1)/3

A graph of the curves y=g(x) and y=x is shown:

image02.png

The points at which these two curves meet have the same x-values as the roots to the equation x3-3x+1=0.

This is because:

At the intersection points, y=g(x) equals y=x

therefore, (x3+1)/3 = x

therefore, x3+1 = 3x

therefore, x3-3x+1 = 0, which is the equation to which the roots we are trying to find.

Therefore the roots of the equation have the same x-values as these intersection points.

Using the formula generated at the beginning,

xn+1=(xn3+1)/3

one can obtain values for the roots. I want to find the root in the interval [0,1]. The table below shows the iteration being generated, using an initial approximation of the root. e.g. x2 was generated using (x13+1)/3, x3 was generated using (x23+1)/3, and so on.

n

xn

1

1.00000000

2

0.66666667

3

0.43209877

4

0.36022563

5

0.34891459

6

0.34749245

7

0.34732002

8

0.34729921

9

0.34729670

10

0.34729640

11

0.34729636

12

0.34729636

13

0.34729636

14

0.34729636

15

0.34729636

16

0.34729636

17

0.34729636

18

0.34729636

...read more.

Conclusion

I used Microsoft Excel to do all of these tables and graphs. In terms of ease of use, the rearrangement method required the least steps as all I had to do was fill the formula in one cell, using cell above as the xn value, and ‘drag down’. This was the quickest and easiest method to produce a table for. The Newton-Raphson method was much the same, however it required the input of a much longer formula, and therefore was slightly more tedious. The decimal search method required the input of a lot of data, even after entering the formula into one of the cells. It requires n+1 tables if I want to find a root to n decimal places. Therefore this was by far the slowest method to use.

In terms of failure, the rearrangement method only gives one root for one rearrangement. In this respect the Newton-Raphson method is better, since it converges to all roots given a suitable starting value. However it has the potential to diverge which is unhelpful. In this respect, the decimal search method is the best, given small enough intervals, as it hardly ever fails once a root is identified in a particular interval.

        -  -

...read more.

This student written piece of work is one of many that can be found in our AS and A Level Core & Pure Mathematics section.

Found what you're looking for?

  • Start learning 29% faster today
  • 150,000+ documents available
  • Just £6.99 a month

Not the one? Search for your essay title...
  • Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

See related essaysSee related essays

Related AS and A Level Core & Pure Mathematics essays

  1. Marked by a teacher

    The Gradient Function

    5 star(s)

    / (2.4-2) = 1.76/0.4 = 4.4 P (2, 2�) and Q (2.2, 2.2�) 2.2� - 2� / 2.2 - 2 = 4.84 - 4 / 0.2 = 4.2 P (2, 2�) and Q (2.01, 2.01�) 2.01� - 2� / 2.01 - 2 = 4.0401 - 4/ 0.01 = 4.01 P (2, 2�)

  2. Methods of Advanced Mathematics (C3) Coursework.

    I am going to look at the route between -2 and -1 particularly. To do this I need to rearrange my formula into the form x=g(x) F(x)=x^5-4x+2 ==> x^5-4x+2=0 ==>x^5=4x-2 ==>x=(4x-2)^0.2 if I plot the graphs of y=x and of y=(4x-2)^0.2 then these graphs will intersect at the points of the routes.

  1. Investigate the number of winning lines in the game of connect 4.

    I will use connect 3 as an example W Formula F S 4 10H-16 10 16 5 14H-22 14 22 6 18H-28 18 28 In the formula column, the first part of the equation increases by 4 each time. The second part is increased by 6 every time.

  2. Numerical solution of equations, Interval bisection---change of sign methods, Fixed point iteration ---the Newton-Raphson ...

    = 0 into the form x = g(x), as both of them are more likely to take more steps to achieve finding a root in a given level of accuracy. Ease of use with available hardware and software It is obvious that the Newton-Raphson method is the fastest to find the root in this case.

  1. MEI numerical Methods

    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.

  2. Arctic Research (Maths Coursework)

    In real life there are other forces that could affect the flight of the plane, however, to make this investigation practical I will not be considering any of these. * The height at which the plane will be during flight will not be considered.

  1. Experimentally calculating the wavelength of an He-Ne laser by means of diffraction gratings

    abs((theoretical value - experimental value)/theoretical value)100% Percent Error = abs((632.8 - 844)/632.8)100% Percent Error � 33.4% 100 lines/mm 1st Fringe Percent Error = abs((theoretical value - experimental value)/theoretical value)100% Percent Error = abs((632.8 - 686)/632.8)100% Percent Error � 8.41% 2nd Fringe Percent Error = abs((theoretical value - experimental value)/theoretical value)100%

  2. C3 COURSEWORK - comparing methods of solving functions

    =0 Examining g?(x) graphically y=x so gradient 1 We can see 0<g?(x)<1 Root to f(x) =0 Since 0<g?(x)< 1 we expect to get staircase convergence and it is a success staircase and the result is the same as the expectations. A rearrangement of the same equation is applied in a situation where the

  • Over 160,000 pieces
    of student written work
  • Annotated by
    experienced teachers
  • Ideas and feedback to
    improve your own work