Let $y^{\prime\prime}(t)+y^{2}(t)-t^{4}-2=0$, where $0\leq t\leq 1$. The boundary conditions are $y(0)=0$ and $y(1)=1$ and so its exact solution is $y(t)=t^{2}$. Now I want to compute the solution by the following method; $x_{n}=x_{n-1}+\alpha_{n-1}\int_{0}^{t}s(1-t)[x^{\prime\prime}_{n-1}(s)+x^{2}_{n-1}(s)-s^{4}-2]ds+\alpha_{n-1}\int_{t}^{1}t(1-s)[x^{\prime\prime}_{n-1}(s)+x^{2}_{n-1}(s)-s^{4}-2]ds$ $n=0,1,2,..$ where the initial guess is $x_{0}(t)=t$. I have set the following code for $t=0.5$ so the exact solution in this case is $y(t)=0.5^{2}=0.25$ and $x_{0}(t)=t=0.5$. Now I set the following code:
Clear[x,s, T, a]
a[n_] := a[n] = 0.70
t=0.5
x[0] = 0.5;
x[n_] := x[n] = x[n-1]+a[n-1]Integrate[s(1-t)(x''[n-1]+(x[n-1])^2-s^4-2),{s,0,t}]
+a[n-1]Integrate[t(1-s)(x''[n-1]+(x[n-1])^2-s^4-2),{s,t,1}]
NumberForm[a1 = {Table[x[i], {i, 0, 7}]}, 5]
and when I run the mathemtica I found some error. Please help me.



