I have a function that is real when u is real and positive.
And L[u,s,t] is an even function in s and t, and it is non-negative with above conditions.
L[u_, s_, t_] :=
Simplify[(1/(16*Pi^2*u^(1/2)*t^3))*(((
4 t (I s + t^2) - (s - I (-2 + t) t) (s -
I t (2 + t)) (Log[-2 + (I s)/t + t] -
Log[2 + (I s)/t + t]))/(8 t^2)) + ((
4 t (-I s + t^2) - (s + I (-2 + t) t) (s +
I t (2 + t)) (Log[-2 - (I s)/t + t] -
Log[2 - (I s)/t + t]))/(8 t^2))),
Assumptions -> {u > 0, s \[Element] Reals, t \[Element] Reals}]
As one can check,
Plot3D does show up (means it is real valued) using u=1
u = 1
Plot3D[L[u, s, t], {s, -10^3 - 1, 10^3 - 1}, {t, 0, 10^3}]
However, this Integral
a[u_?NumericQ] := NIntegrate[
u^(5/2)/2*(Log[1 + L[u,s,t]] - L[u,s,t]/(1 + L[u,s,t])), {t, 0,
10^3}, {s, -10^3, 10^3}, Exclusions -> {0, 0}] // Chop
And seems like this integral,returns me complex.
For instance,
a[1.]
gives
NIntegrate::eincr: The global error of the strategy GlobalAdaptive has
increased more than 2000 times. The global error is expected to decrease
monotonically after a number of integrand evaluations. Suspect one of the
following: the working precision is insufficient for the specified precision
goal; the integrand is highly oscillatory or it is not a (piecewise) smooth
function; or the true value of the integral is 0. Increasing the value of
the GlobalAdaptive option MaxErrorIncreases might lead to a convergent
numerical integration. NIntegrate obtained 4.84092 +2.25059 I and
1.8852748239554364` for the integral and error estimates.
With result of
4.84092 + 2.25059 I
where I is imaginary unit.
Why is this happening? Any help will be greatly thanked!
Thank you!
--------------------------ADDED-----------------------------------
What I really meant to do above was addition of complex conjugates
L[u_, s_,
t_] := (1/(16*Pi^2*u^(1/2)*t^3))*(((
4 t (I s + t^2) - (s - I (-2 + t) t) (s -
I t (2 + t)) (Log[-2 + (I s)/t + t] -
Log[2 + (I s)/t + t]))/(8 t^2)) +
Conjugate[((
4 t (I s + t^2) - (s - I (-2 + t) t) (s -
I t (2 + t)) (Log[-2 + (I s)/t + t] -
Log[2 + (I s)/t + t]))/(8 t^2))])
Maybe I took complex conjugate wrong before. This does give me real answers. (Maybe I missed something again?).
But the integral written above still provides me complex answer (with the error above)
Another issue I encountered was that if I perform Rationalize and FullSimplify on L[u,s,t], the plot actually looks different from the original version of the equation. But for now, I will use the original form and not worry about this.
L[1, 0, 1]
is(4 - 3 I π + Log[27])/(64 π^2)
$\endgroup$L
fors == 0 && t < 2
. $\endgroup$