Combine Newton method and Trapezoidal/composite Simpsons rule

857 Views Asked by At

I got this function:

$$f(z) = \int_{0}^1 \sin(\pi z x) e^x dx$$

and I'm asked to calculate $z$ numerically, so that:

$$f(z) = 1$$

I think that I can use two numerical methods.

Newton's method can help me to find the zeros of the function $f(z)$ and Trapezoidal rule to estimate the integral.

The Newton-Raphson method is given by:

$$\displaystyle z_{n+1} = z_n - \dfrac{f(z_n)}{f'(z_n)} = z_n - \dfrac{\displaystyle \int_0^{1} \sin(\pi zx) e^{x}~dx - 1}{{f'(z)}}$$

How do I get $f'(z)$? 

And then at each iteration, I think I can use the Trapezoidal rule to find the value of that integral for the next $z_n$.

Trapezoidal rule: $$\int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right) = \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1}))$$

Am I wrong? How can I solve the problem? I'm stuck and the course literature can't help me.

Thanks!

1

There are 1 best solutions below

0
On

You could've used Taylor expansion as well:

$$\sin(\pi zx)=\sum_{n=0}^\infty\frac{(-1)^n(\pi z)^{2n+1}}{(2n+1)!}x^{2n+1}$$

Thus,

$$f(z)=\sum_{n=0}^\infty\frac{(-1)^n(\pi z)^{2n+1}}{(2n+1)!}\int_0^1x^{2n+1}e^x\ dx$$

By Taylor expanding $e^x$, we get

$$\int_0^1x^{2n+1}e^x\ dx=\sum_{k=0}^\infty\int_0^1\frac{x^{2n+1+k}}{k!}\ dx=\sum_{k=0}^\infty\frac1{k!(2n+1+k)}$$

And thus,

$$f(z)=\sum_{n=0}^\infty\frac{(-1)^n(\pi z)^{2n+1}}{(2n+1)!}\sum_{k=0}^\infty\frac1{k!(2n+1+k)}$$


Alternatively, integration by parts can solve $\int_0^1x^{2n+1}e^x\ dx$.