# How can I create loop for this iteration integration [closed]

I have definite integral of the form $$f(x)=\int_{-\pi}^\pi\frac{x^2-1}{(x^2-1)^2+x^2+y^2+f(x)}dxdy$$ I want to make a code to calculate $$f(x)$$ numerically, starting from $$f(x)=0$$ and stopping when the solution converges.

• Your integral is not "definite", or is it? – AccidentalFourierTransform Jul 4 '19 at 16:38
• Chiming in with @AccidentalFourierTransform this problem is ill-defined because indefinite integrals are only defined up to an arbitrary constant, which matters here. – Roman Jul 4 '19 at 16:43
• I'm voting to close this question as off-topic because the OP needs to figure out the relevant math first before asking for a technical solution. – Roman Jul 4 '19 at 16:46
• Is {- Pi, Pi} meant to be the integration limits in both x and y? If so, the integral in y can be performed symbolically in terms of ArcTan. – bbgodfrey Jul 7 '19 at 12:59

I don't really understand the exact integral you want to compute, but here is one approach to iterating integrals. Say you want to integrate f[x]=x/(x+f[x]) and then integrate that result, and so on. Here is a way to do it that shows the first 10 iterations:

NestList[Integrate[x/(x + #), x] &, 0, 10]


Here's an example that is slightly closer to the function you suggest -- it starts at 0 and iterates f[x]=1/(x^2 + f[x]):

NestList[(Integrate[1/(x^2 + #), x] &) // FullSimplify, 0, 5]


but notice that it already gets very complicated because all the integrals do not have simple closed forms.

If you are sure the integral series converges, you can replace NestList with FixedPoint, for instance:

FixedPoint[Integrate[1/(x^2 + #), x] &, 0]


but this one doesn't seem to converge.

• Thanks, @bill s. But how to use the condition of matching new value to old value of $f(x)$ to some significant figures and then stop – zain ud din Jul 7 '19 at 4:55