# How to solve complicated differential equation having non-linear integration

Please help me solving the variation of f and g with z in this nonlinear second order differential equation containing non-linear part in the integration. The nonlinear part comes out to be infinite series on expansion. I have used the following approach, anyone please give me suitable advice for this. Thank you.

 A = 1/f[z]^3

B = x*y^(-1/2)*Exp[-2*x]*
Exp[-2*y]*(1 + (1/(f[z]^2 * g[z])) (Exp[-x]*Exp[-y]*x^2))^(-1/2)

C1 = Integrate[B, {x, 0, Infinity}, {y, 0, Infinity}]

D1 = 1/g[z]^2

E1 = x*y^(1/2)*Exp[-2*x]*
Exp[-2*y]*(1 + (1/(f[z]^2 * g[z])) (Exp[-x]*Exp[-y]*x^2))^(-1/2)

F = Integrate[E1, {x, 0, Infinity}, {y, 0, Infinity}]

F1 = C1 - (1/f[z])*(D[f[z], z])^2

G1 = F - (1/g[z])*(D[g[z], z])^2

sol = NDSolve[{D[f[z], {z, 2}] == F1, D[g[z], {z, 2}] == G1,
f == 1, f' == 0, g == 1, g' == 0}, {f[z], g[z]}, {z, 0,
5}]

• It gets stuck on C1 = Integrate[B, {x, 0, Infinity}, {y, 0, Infinity}] and F = Integrate[E1, {x, 0, Infinity}, {y, 0, Infinity}] and both are needed later for the NDSolve. This is a very difficult problem. Would you mind telling me what what physical/natural/scientific problem this comes from? Jul 20, 2020 at 11:53
• Actually, I want to check the variation of f and g with z(distance). I want these to check focusing of spot size of some particle beam with distance using these two differential coupled equations. Jul 20, 2020 at 12:03

Hint.

n = 3;
tmax = 5;
E1 = x*y^(1/2)*Exp[-2*x]*Exp[-2*y]*(1 + fg (Exp[-x]*Exp[-y]*x^2))^(-1/2)
F = Integrate[Normal[Series[E1, {fg, 0, n}]], {x, 0, Infinity}, {y, 0, Infinity}] /. {fg -> 1/f[z]^2/g[z]}
F1 = F - (1/f[z])*(D[f[z], z])^2
G1 = F - (1/g[z])*(D[g[z], z])^2
sol = NDSolve[{D[f[z], {z, 2}] == F1, D[g[z], {z, 2}] == G1, f == 1, f' == 0, g == 1, g' == 0}, {f[z], g[z]}, {z, 0, tmax}][]
Plot[Evaluate[{f[z], g[z]} /. sol], {z, 0, tmax}]

• Thanks for the reply. But the main problem is in the integration part having (1+variables)^(-1/2) in E1 i.e. the term (1 + (1/(f[z]^2 * g[z])) (Exp[-x]*Exp[-y]*x^2))^(-1/2) and then its integration through F = Integrate[E1, {x, 0, Infinity}, {y, 0, Infinity}] Jul 20, 2020 at 12:11
• I hadn't noticed the E1 dependency on $z$ Perhaps now this works.I tried it with n from 2 to 10 with no noticeable difference in response Jul 20, 2020 at 13:41
• It is really helpful. Actually I have approached this problem in a similar way by using binomial theorem i.e. upto n=2 limit. Is there any other approach in which it is not required to limit the expansion in this approach? Jul 21, 2020 at 6:06