Skip to content
PostNumerical Computation / Assignment

Numerical-Computation-As-2

2025-10-06
Back to Blog

Numerical-Computation-As-2

Question 1.

(a) Use the Intermediate Value Theorem to find an interval of length one that contains a root of the equation:

(1)x3=9,(2) 3x3+x2=x+5,(3) cos2x+6=x

We need to find an interval of length one, [a,b] where ba=1, such that f(a) and f(b) have opposite signs.

(1) let f(x)=x39 and a=2,b=3

  • f(a)=1<0
  • f(b)=18>0

Therefore, the interval is [2,3].

(2) let g(x)=3x3+x2x5 and a=1,b=2

  • g(a)=2
  • g(b)=24+425=21

Therefore, the interval is [1,2].

(3) let h(x)=cos2xx+6 and a=6,b=7

  • h(a)=cos260.9219
  • h(b)=cos2710.4316<0

Therefore, the interval is [6,7].

(b) By the Bisection Method, how many steps are needed to have an approximate root within 18 of the true root using the interval you found in (a), and why?

The error Formula:

|pcn|ba2n+1

Since ba=1 Therefore 12n+1<18 Then n>2 so n=3

3 steps are needed to guarantee that the approximate root is within 18 of the true root for all three cases. This is because with an initial interval of length 1, four iterations will reduce the error bound to 124=116, which is less than 18​. Three steps would only guarantee an error within 123=18​, which is not strictly within 18.

(c) Consider three equations. Apply two steps of the Bisection Method to find an approximate root.

(1) Equation: x3=9

Let f(x)=x39. The initial interval is [a0,b0]=[2,3].

Step 1:

f(2)=1,f(3)=18>0f(2)f(3)<0c=2+32=2.5>0

Therefore a1=2,b1=2.5 $$f(2)=-1<0, f(2.5)=\frac{53}{8}>0$$

Step 2:

c=2.25f(2.25)>0

Therefore $$a_2=2, b_2=2.25$$ $$x_a=\frac{2+2.25}{2}=2.125$$

(2) Equation: 3x3+x2=x+5

Let g(x)=3x3+x2x5. The initial interval is [a0,b0]=[1,2].

Step 1:

f(1)=3(1)3+(1)215=2<0f(2)=3(2)3+(2)225=21>0f(1)f(2)<0c=1+22=1.5f(1.5)=3(1.5)3+(1.5)21.55=5.875>0

[a1,b1]=[1,1.5].

Step 2:

c=1+1.52=1.25f(1.25)=3(1.25)3+(1.25)21.255=1.171875>0

[a2,b2]=[1,1.25].

xa=1+1.252=1.125

(3) Equation: cos2x+6=x

Let h(x)=cos2x+6x. The initial interval is [a0,b0]=[6,7].

Step 1:

f(6)=cos2(6)+66=cos2(6)0.9219>0f(7)=cos2(7)+67=cos2(7)10.4317<0c=6+72=6.5f(6.5)=cos2(6.5)+66.50.4777>0

[a1,b1]=[6.5,7].

Step 2:

c=6.5+72=6.75f(6.75)=cos2(6.75)+66.750.0254>0

[a2,b2]=[6.75,7].

xa=6.75+72=6.875

Question 2.

Which of the following three Fixed-Point Iterations converge to the cube root of 4? Rank the ones that converge from fastest to slowest.

(A) g(x)=2x

  1. Fixed Point:: g(43)=243=2(41/3)1/2=241/6. Since 2=4=41/2, we have: g(p)=41/241/6=4(1/21/6)=4(3/61/6)=42/6=41/3=p.

  2. Convergence: We find the derivative g(x). g(x)=2x1/2g(x)=2(12)x3/2=x3/2=1xx. Now, we evaluate |g(p)|: |g(p)|=|1pp|=1(41/3)3/2=14(1/33/2)=141/2=12. Since |g(p)|=12<1, iteration converges.

(B) g(x)=3x4+1x2

  1. Fixed Point:: g(p)=3p4+1p2. Since p3=4, we can write 1p2 as pp3=p4. g(p)=3p4+p4=4p4=p. Yes, it has the correct fixed point.

  2. Convergence: We find the derivative g(x). g(x)=34x+x2g(x)=342x3=342x3. Now, we evaluate |g(p)|: |g(p)|=|342p3|=|3424|=|3412|=|14|=14. Since |g(p)|=1/4<1, iteration converges.

(C) g(x)=23x+43x2

  1. Fixed Point:: g(p)=23p+43p2. Since p3=4, we can write 4p2 as p3p2=p. g(p)=23p+p3=3p3=p. Yes, it has the correct fixed point.

  2. Convergence: We find the derivative g(x). g(x)=23x+43x2g(x)=23+43(2x3)=2383x3. Now, we evaluate |g(p)|: |g(p)|=|2383p3|=|2383(4)|=|23812|=|2323|=0.

Since |g(p)|=0<1, iteration (C) converges. , the speed of converge from quick to slow is C>B>A

Question 3.

Apply two steps of Newton's Method with initial guess x0=1 on the equation x2+1x+13x=0.

let f(x)=x23x+1x+1

f(x)=2x31(x+1)2

The formula for Newton's Method is:

xk+1=xkf(xk)f(xk)

The initial guess x0=1.

Step 1: Calculate x1

We start with x0=1. We need to calculate f(x0) and f(x0).

f(1)=13+12=1.5$$$$f(1)=2314=1.25

Apply the formula to find x1:

x1=x0f(x0)f(x0)=11.51.25x1=11.2x1=0.2

Step 2: Calculate x2

Now we use x1=0.2 as our new guess. We need to calculate f(x1) and f(x1).

f(0.2)=0.04+0.6+10.8=0.64+1.25=1.89f(0.2)=3.410.64=3.41.5625=4.9625

Apply the formula to find x2:

x2=x1f(x1)f(x1)=0.21.894.96250.180856

After two steps of Newton's Method, the approximate root is x20.180856.

Question 4.

Considering the equation x3x25x3=0, with roots r=1, r=3. Estimate the error ei+1 in terms of the previous error ei as Newton's Method converges to the given roots.
Is the convergence linear or quadratic?

The formula for Newton's Method is xn+1=g(xn) where g(x)=xf(x)f(x). The error after step i is ei=xir. The relationship between consecutive errors is given by:

  • If f(r)0 (simple root), convergence is quadratic, and ei+1f(r)2f(r)ei2.

  • If f(r)=0 (multiple root), convergence is linear, and ei+1(11m)ei, where m is the multiplicity of the root.

  • f(x)=x3x25x3

  • f(x)=3x22x5

  • f(x)=6x2

Case 1: Root r=3

  1. Check for Multiplicity: We evaluate f(x) at the root r=3. f(3)=3(3)22(3)5=2765=16. Since f(3)=160, the root r=3 is a simple root (multiplicity 1).

  2. Determine Convergence Rate: Because it is a simple root, the convergence is quadratic.

  3. Estimate the Error Relationship: We use the formula for quadratic convergence: ei+1f(r)2f(r)ei2. We need to calculate f(3): f(3)=6(3)2=182=16.

    ei+116216ei2=1632ei2

    Therefore, for the root r=3, the error relationship is:

    ei+112ei2

Case 2: Root r=1

  1. Check for Multiplicity: We evaluate f(x) at the root r=1. f(1)=3(1)22(1)5=3+25=0. Since f(1)=0, this is a multiple root. We need to find its multiplicity. Let's check the next derivative: f(1)=6(1)2=8. Since f(1)=0 but f(1)0, the multiplicity of the root r=1 is m = 2 (a double root).

  2. Determine Convergence Rate: Because it is a multiple root, the convergence is linear.

  3. Estimate the Error Relationship: We use the formula for linear convergence for a root of multiplicity m=2: ei+1(11m)ei.

    ei+1(112)ei

    Therefore, for the root r=1, the error relationship is:

    ei+112ei

Question 5.

Apply two steps of the Secant Method on the interval with initial guesses x0=1 and x1=2 to find the approximate root of ex+x=7.

First, we define our function f(x) by setting the equation to zero:

f(x)=ex+x7

The formula for the Secant Method is:

xk+1=xkf(xk)(xkxk1)f(xk)f(xk1)

We are given the initial guesses x0=1 and x1=2.

Step 1: Calculate x2

We start by calculating the function values at our initial guesses, f(x0) and f(x1).

  • Calculate f(x0):

    f(x0)=f(1)=e1+17=e62.718286=3.28172
  • Calculate f(x1):

    f(x1)=f(2)=e2+27=e257.389065=2.38906
  • Apply the formula to find x2:

    x2=x1f(x1)(x1x0)f(x1)f(x0)x2=2(2.38906)(21)(2.38906)(3.28172)1.57871

Step 2: Calculate x3

  • Calculate f(x2):

    f(x2)=f(1.57871)=e1.57871+1.578717=0.57274
  • Apply the formula to find x3:

    x3=x2f(x2)(x2x1)f(x2)f(x1)x3=1.57871(0.57274)(1.578712)(0.57274)(2.38906)1.66019

After two steps of the Secant Method, the approximate root is x31.6602.