## Description

please provide some basic explanation about the answer of each question and also details are required. For programming question, please use matlab. Appreciate,

### Unformatted Attachment Preview

Purchase answer to see full attachment

## Explanation & Answer

Hey there 😀 , the answers are in the attachments. doc ad pdf files are the written answers and the matlab files are in zip file.Don't forget that the function files (tanTaylor.m, myexo.m, myexp2.m, and lagrangePoly.m) need to be in a folder defined in Home -> Set Path for the other files to work.Let me know if you have problems opening any of the files.

1.

a)

For this case, we have an indeterminate form of the type 0/0, so we can use L’Hospital’s

rule to find the limit:

(1 − cos 𝑥)′

1 − cos 𝑥

sin 𝑥

=

lim

= lim

2

2

𝑥→0

𝑥→0

𝑥→0 2𝑥

𝑥

(𝑥 )′

lim

Which is another indeterminate form of the 0/0 type, so we can apply L’Hospital’s rule

again:

lim

𝑥→0

sin 𝑥

(sin 𝑥)′

cos 𝑥 1

= lim

= lim

=

𝑥→0

𝑥→0

2𝑥

(2𝑥)′

2

2

lim

𝑥→0

1 − cos 𝑥 1

=

𝑥2

2

b)

For a sequence converging to L,

|𝑥𝑘+1 − 𝐿|

=𝜇

𝑘→∞ |𝑥𝑘 − 𝐿|

lim

If 0 < 𝜇 < 1, the sequence converges linearly.

We can verify that for a sequence of 𝑥𝑘 = 10−𝑘 with = 1,2, … :

|𝑓(𝑥𝑘+1 ) − 𝐿|

1

=

𝑘→∞ |𝑓(𝑥𝑘 ) − 𝐿|

100

lim

1

Since 0 < 𝜇 < 1, 𝑓(𝑥𝑘 ) converges to 𝐿 = 2 linearly.

c)

The following table displays the value of 𝑓(𝑥) for the given values of x, calculated with

MATLAB:

𝒙

𝟏𝟎−𝟏

𝟏𝟎−𝟐

𝟏𝟎−𝟑

𝟏𝟎−𝟒

𝟏𝟎−𝟓

𝟏𝟎−𝟔

𝟏𝟎−𝟕

𝟏𝟎−𝟖

𝟏𝟎−𝟗

𝟏𝟎−𝟏𝟎

𝒇(𝒙)

0.499583472197429

0.499995833347366

0.499999958325503

0.499999996961265

0.500000041370186

0.500044450291171

0.499600361081321

0

0

0

We can see that the result gets increasingly close to 0.5 until 𝑥 = 10−5, from then, it

diverges until at 𝑥 = 10−8 the calculation returns zero.

d)

From item c, around 𝑟 = 10−8 relative errors close to 100% are experienced calculating

𝑓(𝑥) when |𝑥| < 𝑟.

e)

Multiplying both the numerator and denominator by (1 + cos 𝑥):

(1 − cos 𝑥) (1 + cos 𝑥)

1 − cos 2 𝑥

sin2 𝑥

=

=

𝑥2

(1 + cos 𝑥) 𝑥 2 (1 + cos 𝑥) 𝑥 2 (1 + cos 𝑥)

sin 𝑥 2

( 𝑥 )

𝑓(𝑥) =

(1 + cos 𝑥)

Evaluating this function for 𝑥𝑘 = 10−𝑘 with 𝑘 = 1,2, … in MATLAB:

𝒙

𝟏𝟎−𝟏

𝟏𝟎−𝟐

𝟏𝟎−𝟑

𝟏𝟎−𝟒

𝟏𝟎−𝟓

𝟏𝟎−𝟔

𝟏𝟎−𝟕

𝟏𝟎−𝟖

𝟏𝟎−𝟗

𝟏𝟎−𝟏𝟎

𝒇(𝒙)

0.499583472197423

0.499995833347222

0.499999958333335

0.499999999583333

0.499999999995833

0.499999999999958

0.500000000000000

0.500000000000000

0.500000000000000

0.500000000000000

We can see that this rearrangement solved the problem, making the value converge to the

limit and therefore we should not expect accuracy problems with smaller values of x.

2...