Approximations. Newton's method - composite Simpson's rule

2.2k Views Asked by At

Can you help me please to solve this problems and if you can give me some helpful information. enter image description here

Thanks!

1

There are 1 best solutions below

1
On

We are asked to find the value of $x$ where:

$$\int_0^x \dfrac{1}{\sqrt{2 \pi}} e^{-t^2/2}~dt = 0.45$$

We need two numerical approaches here. One to find the zeros of the function $f(x)$, Newton's Method, and one to estimate the integral, Composite Simpson and Composite Trapezoidal, above where:

$$f(x) = \int_0^x \dfrac{1}{\sqrt{2 \pi}} e^{-t^2/2}~dt - 0.45 = 0$$

The derivative wrt $x$ of this function is (there is a slight typo in problem specification):

$$f'(x) = \dfrac{1}{\sqrt{2 \pi}} e^{-x^2/2}$$

The Newton-Raphson method is given by:

$$\displaystyle x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)} = x_n - \dfrac{\displaystyle \int_0^{x_n} \dfrac{1}{\sqrt{2 \pi}} e^{-t^2/2}~dt - 0.45}{\dfrac{1}{\sqrt{2 \pi}} e^{-x_n^2/2}}$$

At each iteration, we have to use the Composite Simpson's Rule to find the value of that integral for the next $x_n$.

$$s = \int_a^b f(x) \approx \dfrac{h}{3} \left( f(a) + f(b) + 4 \sum_{i=1}^{n/2}~f(a + (2i - 1)h)+2 \sum_{i=1}^{(n-2)/2} f(a+2 ih) \right)$$

The initial starting point is $x_0 = 0.5$ with a desired accuracy of $10^{-5}$.

The iterations are:

  • $x_0 = 0.5$
  • Using Composite Simpson, with $n=4$: $s$ evaluated between $(0, 0.5)$ gives $s = 0.191463$
  • Using Newton's iteration: $x_1 = x_0 - \dfrac{f(x_0)}{f'(x_0)} = 0.5 - \dfrac{0.191463 - 0.45}{0.352065} = 1.23435$
  • $s$ evaluated between $(0, 1.23435)$ gives $s = 0.391464$
  • $x_2 = 1.54866$
  • $s = 0.439269$
  • $x_3 = 1.63789$
  • $s = 0.449278$
  • $x_4 = 1.64481$
  • $s = 0.449278$
  • $x_5 = 1.64485$
  • $s = 0.45$
  • $x_6 = 1.64485$
  • It took five iterations to converge to the desired accuracy.

Lets compare this to the exact result and validate we found the correct value of $x$. We have:

$$\int \dfrac{1}{\sqrt{2 \pi}} e^{-x^2/2}~dx = \frac{1}{2} \text{erf}\left(\frac{x}{\sqrt{2}}\right)$$

Evaluating this at $x = 1.64485$ yields:

$$\frac{1}{2} \text{erf}\left(\frac{1.64485}{\sqrt{2}}\right) = 0.45$$

Repeat this exact same procedure using the Composite Trapezoidal Rule for calculating the values of $s$.

Curious question, is it possible to calculate the value of $n$ for the desired accuracy apriori to doing the iterative steps when using these two numerical approaches? Probably, but I will leave that for you to ponder.