Simplifying equation into Newton Raphson form

257 Views Asked by At

Given the equation $\displaystyle{\int_{-x}^x\exp({-t^2})dt}=-\ln(x)$:

a. Simplify the integral using Gauss method with 3 points.

b. Solve given equation by Newton Raphson iterative method

I succeeded simplifying the integral and got $\int\exp(-t^2)=\frac 8 9 +\frac {10} 9 e^{-0.36x^2}$ but I NR method required function (since the form of $x_{k+1}=x_k+\frac{f(x_k)}{f\prime(x_k)}$) which I haven't found yet here in $-\ln(x)=\frac 8 9 +\frac {10} 9 e^{-0.36x^2}$. which elements should I take to be my $f(x)$?

2

There are 2 best solutions below

3
On BEST ANSWER

I did not check the first part , but I think there is an issue as we should be able to validate the LHS and RHS when we find our $x$, and that is not checking out. Note, you formula did not specify which Gauss method to use and that normally means Gauss-Legendre which use Legendre Polynomials as $\displaystyle \int_{-1}^1 f(x)~dx$ and then use a suitable transformation over $a, b$.

However, here is the process for part b that you are asking about.

$$\displaystyle f(x) = \ln(x)+\frac 8 9 +\frac {10} 9 e^{-0.36x^2}$$

Now, set-up your iteration formula for NR, choose a starting point and find $x$.

A plot shows and approximate location:

enter image description here

The iteration is given by:

$$x_{n+1} = x_n - \dfrac{f(x)}{f'(x)}$$

I chose $x_0 = 0.4$ and got $x = 0.13634195512062696$.

You can verify that at that value of $x$:

$$-\ln(x)=\frac 8 9 +\frac {10} 9 e^{-0.36x^2}$$

However, using a numerical integrator on the LHS with that value of $x$, does not match the RHS, $-\ln x$, so the Gaussian Quadrature result likely has an issue.

Using Cipra's update, we have:

$$\displaystyle f(x) = \ln(x)+ \frac 8 9 x +\frac {10} 9 e^{-3/5 x^2}x$$

A plot shows:

enter image description here

Using NR, with $x_0 = 0.4$ results in $x = 0.4386233081179400$, which checks out for both sides of:

$$\displaystyle{\int_{-x}^x\exp({-t^2})dt}=-\ln(x)$$

0
On

I think what you need to do is rewrite the integral using the change of variable $t=ux$ and then using Gauss quadrature to get

$$\int_{-x}^x \exp(-t^2)dt= x\int_{-1}^1 \exp(-x^2u^2)du = x\left({8\over9}+{10\over9}e^{-3x^2/5} \right)$$

Now letting

$$f(x)=\ln x+{8\over9}x+{10\over9}xe^{-3x^2/5}$$

the Newton-Raphson approach shown in Amzoti's answer should produce a better approximate solution.

Note: If the problem hadn't asked for Gauss quadrature, I would have simply noted that $x$ must lie between $0$ and $1$ (since $-\ln x$ starts at $\infty$ and drops to $0$ while the integral starts at $0$ and becomes positive) and then let

$$\int_{-x}^x \exp(-t^2)dt=\int_{-x}^x(1-t^2+{t^4\over2}-{t^6\over6}+\cdots)dt\approx2(x-{1\over3}x^3+{1\over10}x^5-{1\over42}x^7)$$

Note that the power series expansion for $e^{-3x^2/5}$ leads to

$$x\left({8\over9}+{10\over9}e^{-3x^2/5} \right)\approx 2x-{2\over3}x^3+{1\over5}x^5-{1\over25}x^7$$

so these agree (as they should) for the first few terms.