Is my solution correct ?

57 Views Asked by At

Determine a fixed-point function $g$ in the interval $[0,1]$ that produces an approximation to a positive solution of $$3x^2-e^x=0$$

So I would rearrange and make $x=ln(3x$^2$)$ and then go on to do the fixed point iterations. Is this approach correct?

So I seem to converge to an $x$ value of $3.733$, and when I sub this back into the original equation I get a tiny number, so this means $3.733$ is a root. But I have not gotten an answer in the interval they wanted. I have attached a graph of the function and this confirms my solution is right, but it also shows there is definitely a root in the $[0,1]$ interval.

enter image description here

2

There are 2 best solutions below

4
On BEST ANSWER

Try $$x=\sqrt{\frac{e^x}{3}}$$. In this case, we have $|f'(x)|<1$ in $[0,1]$, and the iteration converges.

Here the result , calculated with PARI/GP :

? x=0.5;for(j=1,20,x=sqrt(exp(x)/3);print(j," ",x))
1 0.7413324199709889361208398841
2 0.8364070066183051613459405716
3 0.8771277404802830654215208597
4 0.8951694275536427355025318820
5 0.9032811431491091689457739862
6 0.9069521625510803920488559043
7 0.9086184107833576010292250539
8 0.9093757181154459427278647507
9 0.9097201217656592735896153888
10 0.9098767907199163601800595891
11 0.9099480682342757627321922068
12 0.9099804982304046485205647953
13 0.9099952536820516219607435332
14 0.9100019674022999255528001152
15 0.9100050221567443868392700394
16 0.9100064120787488118773700570
17 0.9100070444979367232541167882
18 0.9100073322509402558905351219
19 0.9100074631796212206355354647
20 0.9100075227526615816811929196
0
On

On $[0,1]$, $e^x\approx 1+x+\frac12x^2$ is a decent approximation. Thus consider $$ \frac52 x^2-x-1=\epsilon(x)=e^x-\frac12x^2-x-1 \\ (5x-1)^2-11=10ϵ(x) \iff x=\frac{1\pm\sqrt{11+10ϵ(x)}}5 $$ and using the positive solution for the iteration:

from math import log,exp,sqrt
eps = lambda x : exp(x)-1-x-x*x/2
g = lambda x : (1+sqrt(11+10*eps(x)))/5
x=0
for k in range(20):
    x=g(x)
    print "k=%2d: x=%.16f" % (k,x)

with the results

k= 0: x=0.8633249580710800
k= 1: x=0.9028630681752560
k= 2: x=0.9088614208553263
k= 3: x=0.9098223955962579
k= 4: x=0.9099776206562101
k= 5: x=0.9100027269792961
k= 6: x=0.9100067885748679
k= 7: x=0.9100074456653353
k= 8: x=0.9100075519709178
k= 9: x=0.9100075691692908
k=10: x=0.9100075719516856
k=11: x=0.9100075724018281
k=12: x=0.9100075724746531
k=13: x=0.9100075724864350
k=14: x=0.9100075724883412
k=15: x=0.9100075724886494
k=16: x=0.9100075724886993
k=17: x=0.9100075724887076
k=18: x=0.9100075724887088
k=19: x=0.9100075724887091