Sorry once more. Here comes a final, compact and correct derivation
Complete compact calculation of the integral.
The main idea is decomposition into partial fractions.
The integrand is
In[1]:= in = -((-1 + Cos[z])/(z^2*(-4*Pi^2 + z^2)^2*(r^2 + z^2)^2));
Decomposing into partial fractions gives
In[2]:= Apart[1/(z^2*(-4*Pi^2 + z^2)^2*(r^2 + z^2)^2)]
Out[2]= 1/(16*Pi^4*r^4*z^2) +
1/(64*Pi^4*(4*Pi^2 + r^2)^2*(-2*Pi + z)^2) + (-28*Pi^2 - 3*r^2)/(128*
Pi^5*(4*Pi^2 + r^2)^3*(-2*Pi + z)) +
1/(64*Pi^4*(4*Pi^2 + r^2)^2*(2*Pi + z)^2) + (28*Pi^2 + 3*r^2)/(128*
Pi^5*(4*Pi^2 + r^2)^3*(2*Pi + z)) -
1/(r^2*(4*Pi^2 + r^2)^2*(r^2 + z^2)^2) + (-4*Pi^2 -
3*r^2)/(r^4*(4*Pi^2 + r^2)^3*(r^2 + z^2))
Frequently, treating a list of terms is better than the sum in order
to see what's going on in detail
In[3]:= ls = List @@ %
Out[3]= {1/(16*Pi^4*r^4*z^2),
1/(64*Pi^4*(4*Pi^2 + r^2)^2*(-2*Pi + z)^2), (-28*Pi^2 - 3*r^2)/(128*
Pi^5*(4*Pi^2 + r^2)^3*(-2*Pi + z)),
1/(64*Pi^4*(4*Pi^2 + r^2)^2*(2*Pi + z)^2), (28*Pi^2 + 3*r^2)/(128*
Pi^5*(4*Pi^2 + r^2)^3*(2*Pi + z)),
-(1/(r^2*(4*Pi^2 + r^2)^2*(r^2 + z^2)^2)), (-4*Pi^2 -
3*r^2)/(r^4*(4*Pi^2 + r^2)^3*(r^2 + z^2))}
Now integrating the list gives
In[4]:= t =
Timing[Table[
Integrate[(1 - Cos[z])*ls[[k]], {z, -Infinity, Infinity},
Assumptions -> r > 0], {k, 1, Length[ls]}]];
t[[1]]
is = t[[2]]
During evaluation of In[4]:= Integrate::idiv:Integral of (-1+Cos[z])/
(2 \[Pi]-z) does not converge on {-\[Infinity],\[Infinity]}. >>
During evaluation of In[4]:= Integrate::idiv:Integral of (-1+Cos[z])/
(2 \[Pi]+z) does not converge on {-\[Infinity],\[Infinity]}. >>
Out[5]= 4.867
Out[6]= {1/(16*Pi^3*r^4), 1/(64*Pi^3*(4*Pi^2 + r^2)^2),
Integrate[((-28*Pi^2 - 3*r^2)*(1 - Cos[z]))/(128*
Pi^5*(4*Pi^2 + r^2)^3*(-2*Pi + z)), {z, -Infinity, Infinity},
Assumptions -> r > 0], 1/(64*Pi^3*(4*Pi^2 + r^2)^2),
Integrate[((28*Pi^2 + 3*r^2)*(1 - Cos[z]))/(128*
Pi^5*(4*Pi^2 + r^2)^3*(2*Pi + z)), {z, -Infinity, Infinity},
Assumptions ->
r > 0], (Pi*(1 - E^r + r))/(E^
r*(2*r^5*(4*Pi^2 + r^2)^2)), ((-1 + E^(-r))*
Pi*(4*Pi^2 + 3*r^2))/(r^5*(4*Pi^2 + r^2)^3)}
Oops, there appear divergences in the third and fifth term.
Ok, let's calculate the sum of both instead
In[65]:= Integrate[(1 - Cos[z])*(ls[[3]] + ls[[5]]), {z, -Infinity,
Infinity}]
Out[65]= 0
Fine, the terms cancel each other.
Now, collecting the results
In[72]:= (is[[#1]] & ) /@ {1, 2, 4, 6, 7}
Out[72]= {1/(16*Pi^3*r^4), 1/(64*Pi^3*(4*Pi^2 + r^2)^2),
1/(64*Pi^3*(4*Pi^2 + r^2)^2), (Pi*(1 - E^r + r))/(E^
r*(2*r^5*(4*Pi^2 + r^2)^2)), ((-1 + E^(-r))*
Pi*(4*Pi^2 + 3*r^2))/(r^5*(4*Pi^2 + r^2)^3)}
Summing up and simplifying gives my (wh) final result
In[73]:= fwh[r_] = Simplify[Plus @@ %]
Out[73]= (28*E^r*Pi^2*r^5 + 3*E^r*r^7 +
64*Pi^6*(3 + r + E^r*(-3 + 2*r)) +
16*Pi^4*r^2*(7 + r + E^r*(-7 + 6*r)))/(E^
r*(32*Pi^3*r^5*(4*Pi^2 + r^2)^3))
In[74]:= fwh[1.]
Out[74]= 0.0004911297292720861
Dmitry's result is slightly more lengthy
In[71]:= fs[
r_] := (-192*Pi^6 + 128*Pi^6*r - 112*Pi^4*r^2 + 96*Pi^4*r^3 +
28*Pi^2*r^5 + 3*r^7 +
16*Pi^4*(4*Pi^2*(3 + r) + r^2*(7 + r))*Cosh[r] -
16*Pi^4*(4*Pi^2*(3 + r) + r^2*(7 + r))*Sinh[r])/(32*Pi^3*
r^5*(4*Pi^2 + r^2)^3)
But both are identical
In[76]:= FullSimplify[fwh[r] == fs[r]]
Out[76]= True
I can also comfirm that the result is in agreement with numerical
calculations using NIntegrate (as was stated earlier by Dmitry).
Regards,
Wolfgang