This is the integral I am trying to solve, and I need to use the answer in a loop which n1a , n2a, n1b
and n2b
are varying from 1 to 10 for instance. But it gives me infinity although I know that I should have finite answer for my integral. Does any one know how to simplify the answer or solve the integral not to get poles in the denominator?
sol = Integrate[4 A Exp[-(s2 - s1)] Sin[n1a π s1] Sin[n1b π s1] Sin[
n2a π s2] Sin[n2b π s2], {s2, s1, 1}] // Expand
sol2 = Integrate[#, {s1, 0, 1}] & /@ (sol)
Just to give you an example, I have previously solved this integral:
sol1 = Integrate[4 A (s2 - s1)^2 Sin[n1a π s1] Sin[n1b π s1] Sin[
n2a π s2] Sin[n2b π s2], {s2, s1, 1}]
which was giving me an answer having n1a-n1b in the denominator, to overcome that, I have calculated the integral this time for n1a=n1b
sol1 = Integrate[4 A (s2 - s1)^2 Sin[n1b π s1] Sin[n1b π s1] Sin[ n2a π s2] Sin[n2b π s2], {s2, s1, 1}]
and then defined the following function,
fxn[n1a_, n1b_, n2a_, n2b_] := N[ Which[
n1a == n1b && n2a == n2b,
1/6 (1 - 3/(n1a^2 \[Pi]^2) - 3/(n2a^2 \[Pi]^2)),
n1a == n1b && n2a != n2b,
(4 (1 + (-1)^(n2a + n2b)) n2a n2b)/((n2a^2 - n2b^2)^2 \[Pi]^2),
n1a != n1b && n2a == n2b,
(4 (1 + (-1)^(n1a + n1b)) n1a n1b)/((n1a^2 - n1b^2)^2 \[Pi]^2),
True, -((
32 (-1 + (-1)^(n1a + n1b)) (-1 + (-1)^(
n2a + n2b)) n1a n1b n2a n2b)/((n1a^2 - n1b^2)^2 (n2a^2 -
n2b^2)^2 \[Pi]^4))]]
to use in the loop, so that I would never get infinity for any value of my variables.
In the new case, the answer is so complicated that applying the same solution is very complicated. I was wondering if anyone have any idea about this.