# solve the iterative integral equatio [duplicate]

The following code is incorrect, please specify my mistakes

y[0, t_] := 4 - 3 t;
y[n_, x_] := 4 - 3 x +
0.59489439*
NIntegrate[
t (1 - x) {D[y[n - 1], {t,2}] - 3/2 y[n - 1, t]^2}, {t, 0, x}] +
0.594894
NIntegrate[
x (1 - t) {D[y[n - 1], {t,2}] - 3/2 y[n - 1, t]^2}, {t, x, 1}]
Table[{n, x, y[n, x]}, {n, 1, 3}, {x, .1, 1, .1}]

• Here the integrand contains derivative term also. I couldn't get the answer. Please anyone correct my mistakes – Thenmozhi S Aug 17 at 13:09
• Please edit your question and show the complete formula y[n,x]=... – Ulrich Neumann Aug 17 at 13:10
• Equation edited – Thenmozhi S Aug 17 at 13:25
• y[n-1,x]'' makes no sense. Please check out how to write partial derivatives. Something like D[y[n-1,x], {x,2}]. – Roman Aug 17 at 14:07
• y[0,x_]:=4-3x; y[n_,x_]:=4-3x+0.59489439*Integrate[x(1-t)(D[y[n-1,t],{t,2}]-3/2 y[n-1,t]^2),{t,0,x}]+0.594894*Integrate[x(1-t)(D[y[n-1,t],{t,2}]-3/2 y[n-1,t]^2),{t,x,1}]; Table[{n,x,y[n,x]},{n,1,3},{x,.1,1,.1}] Test that very carefully to see if it is correct. – Bill Aug 18 at 5:21

Here an approach to solve the problem using NestList

sol = NestList[
Function[y,FunctionInterpolation[4 - 3 x +
0.59489439*Integrate[t (1 - x) (D[y[ t], {t, 2}] - 3/2 y[ t]^2), {t, 0, x}] +
0.594894*Integrate[x (1 - t) (D[y[ t], {t, 2}] - 3/2 y[ t]^2), {t, x, 1}], {x, 0,1 }]
] (* Ende Function *)
, 4 - 3 #   &  (* Startwert *)
, 10]


The iterated solutions swap between two fixpoint functions, one of them 4-3x

Plot[Through[sol [x]], {x, 0, 1}, Evaluated -> True] • Sir, but I didn't get output – Thenmozhi S Aug 18 at 19:03
• Sorry, I edited my answer (initial condition double & was wrong) – Ulrich Neumann Aug 18 at 19:14
• I'm a beginner to Mathematica, so that I'm having lot of doubts and doing mistakes while writing the code. Please help me to correct it – Thenmozhi S Aug 18 at 19:21
• Try to copy my code and run it. You only have to check the equations(I don't know the background). – Ulrich Neumann Aug 18 at 19:24
• Yes sir, I did the same, but didn't get the answer – Thenmozhi S Aug 18 at 19:26

There is an exact solution that coincides with the numerical solution @UlrichNeumann at the first iterations:

y = 4 - 3 t; $Assumptions = a > 0 && b > 0; Table[ y[n] = With[{y = y[n - 1]}, 4 - 3 x + a*Integrate[ t (1 - x) (D[y /. x -> t, {t, 2}] - 3/2 (y /. x -> t)^2), {t, 0, x}] + b* Integrate[ x (1 - t) (D[(y /. x -> t), {t, 2}] - 3/2 (y /. x -> t)^2), {t, x, 1}]], {n, 1, 3}]  Here we get a very long expression even at the third iteration. Compare y[n]and numerical solution of the equation obtained by Ulrich Neumann Plot[Evaluate[ Table[y[n] /. {a -> 0.59489439, b -> 0.594894}, {n, 1, 3}]], {x, 0, 1}, PlotLegends -> Automatic] sol = NestList[ Function[y, FunctionInterpolation[ 4 - 3 x + 0.59489439* Integrate[ t (1 - x) (D[y[t], {t, 2}] - 3/2 y[t]^2), {t, 0, x}] + 0.594894* Integrate[ x (1 - t) (D[y[t], {t, 2}] - 3/2 y[t]^2), {t, x, 1}], {x, 0, 1}]] (*Ende Function*), 4 - 3 # & (*Startwert*), 4]; Table[Plot[{y[i] /. {a -> 0.59489439, b -> 0.594894}, sol[[i + 1]][x]}, {x, 0, 1}, PlotLabel -> i], {i, 1, 3}] From the discussion it became clear that the author wanted to solve the equation y''[t]==(3/2)y[t]^2 with boundary conditions BCs={ y==4, y==1}. This problem has an exact solution y=4/(1+t)^2. But then the iterative scheme was built incorrectly. To build a converging process, we need to put in my scheme y = 4 - 3 x;$Assumptions = a > 0 && b > 0; Table[
y[n] = With[{y = y[n - 1]},
y + a*Integrate[
t (1 - x) (D[y /. x -> t, {t, 2}] - 3/2 (y /. x -> t)^2), {t, 0,
x}] + b*
Integrate[
x (1 - t) (D[(y /. x -> t), {t, 2}] - 3/2 (y /. x -> t)^2), {t,
x, 1}]], {n, 1, 3}]


We can optimize the parameters a, b using the exact solution

FindMinimum[
Sum[(y - 4/(1 + x)^2)^2, {x, 0, 1, .1}], {{a, .59}, {b, .59}}]

(*{0.00051333, {a -> 0.556396, b -> 0.653769}}*)


Let's check how different the solution at each iteration is from the exact solution

Table[Plot[(y[i] /. {a -> 0.5563963697722774,
b -> 0.6537687187362005}) - 4/(1 + x)^2, {x, 0, 1},
PlotLabel -> i], {i, 1, 3}] We see that with optimized parameters the process converges quite quickly. Change the numerical scheme @UlrichNeumann using non-optimized parameters

sol = NestList[
Function[y,
FunctionInterpolation[
y[x] + 0.59489439*
Integrate[
t (1 - x) (D[y[t], {t, 2}] - 3/2 y[t]^2), {t, 0, x}] +
0.594894*
Integrate[
x (1 - t) (D[y[t], {t, 2}] - 3/2 y[t]^2), {t, x, 1}], {x, 0,
1}]] (*Ende Function*), 4 - 3 # &  (*Startwert*), 4];


and compare with the exact solution

Table[Plot[(sol[[i]][x]) - 4/(1 + x)^2, {x, 0, 1},
PlotLabel -> i], {i, 2, 4}] We see that with non-optimized parameters the process converges worse (but converges!). Change the parameters to the optimal ones. We see that the process apparently converges and stops after the third iteration

    sol1 = NestList[
Function[y,
FunctionInterpolation[
y[x] + 0.5563963697722774*
Integrate[
t (1 - x) (D[y[t], {t, 2}] - 3/2 y[t]^2), {t, 0, x}] +
0.6537687187362005*
Integrate[
x (1 - t) (D[y[t], {t, 2}] - 3/2 y[t]^2), {t, x, 1}], {x, 0,
1}]] (*Ende Function*), 4 - 3 # &  (*Startwert*), 7];

Table[Plot[(sol1[[i]][x]) - 4/(1 + x)^2, {x, 0, 1},
PlotLabel -> i], {i, 2, 7}] A numerical solution with nonoptimized parameters behaves similarly • Thank you sir, other than graph, for the table of numerical values up to 20 or 30 iterations which code can we use? – Thenmozhi S Aug 20 at 6:24
• @ThenmozhiS First, what do you want to get? Secondly, what equation do you want to solve? You should describe the problem in mathematical language. We decided on the equation at our discretion. Do a and b really have such values in your equation? – Alex Trounev Aug 20 at 7:50
• While solving the second order boundary value problem y''[t]=(3/2)y[t]^2 with BCs: y=4, y=1 by using Fixed point iterative scheme(2 step), we obtain the above mentioned volterra integral equation. In that scheme a sequence (a_n) appeared, for optimum value for a_n, it taken as 0.59... In the above eqution a=b=a_n – Thenmozhi S Aug 20 at 13:55
• @ThenmozhiS Boundary value problem y''[t]==(3/2)y[t]^2 with BCs={ y==4, y==1} has exact solution y=4/(1+t)^2. – Alex Trounev Aug 20 at 15:17
• yes sir, but we are trying to apply fixed point iteration scheme to obtain solution for higher order boundary value problem(I got this idea somewhere else). – Thenmozhi S Aug 20 at 16:15