Well-defined symbolic integral leading to ConditionalExpression
You can gain insight by evaluating and then simplifying the indefinite integrals.
Integrate[(1 + b x + c y)/(1 + e x + f y + I η), y, x, Assumptions -> {x ∈ Reals,
y ∈ Reals, b ∈ Reals, c ∈ Reals, e ∈ Reals,f ∈ Reals, η ∈ Reals, η != 0}];
ans = Collect[%, {ArcTan[η/(1 + e x + f y)], Log[1 + e^2 x^2 + 2 f y + f^2 y^2 +
2 e (x + f x y) + η^2]}, Simplify]
The result is free of conditions but contains an ArcTan
function, which is multi-valued, changing sign at 1 + e x + f y == 0
.
(* ((I/2)*(f*(b*(e^2*x^2 - (1 + f*y + I*η)^2) + 2*e*(1 + e*x + I*η)) -
c*e*(1 + e*x + I*η)^2)*ArcTan[η/(1 + e*x + f*y)])/(e^2*f^2) +
(y*(f*(-4*e + b*(2 + 2*e*x + f*y + (2*I)*η)) +
c*e*(2 + 2*e*x - f*y + (2*I)*η) + 2*e*f*(2 + c*y)*
Log[1 + e*x + f*y + I*η]))/(4*e^2*f) +
((f*(b*(e^2*x^2 - (1 + f*y + I*η)^2) + 2*e*(1 + e*x + I*η)) -
c*e*(1 + e*x + I*η)^2)*Log[1 + e^2*x^2 + 2*f*y + f^2*y^2 +
2*e*(x + f*x*y) + η^2])/(4*e^2*f^2) *)
A sample plot of Im[ans]
is given by
Plot3D[Evaluate[Im[ans] /. {b -> 3, c -> 3, e -> -3, f -> 3, η -> .1}],
{x, -1/2, 1/2}, {y, -1/2, 1/2}, PlotRange -> All, PlotPoints -> 50,
AxesLabel -> {x, y, "Im[ans]"}, ImageSize -> 500, Exclusions -> None]
However, obviously the integral itself is not discontinuous, the discontinuity in ans
arising from the branch cut in ArcTan
. But, we are free to choose a different branch that eliminates this spurious discontinuity. Doing so can be accomplished by defining
myarctan[z_] := Piecewise[{{ArcTan[z], z > 0}, {Pi + ArcTan[z], z < 0}}, Pi/2];
and making the substitution
ans = ans /. ArcTan -> myarctan
The redefined ans
is continuous.
Alternative to myarctan
The substitution
ans = ans /. ArcTan[z_] :> Pi/2 - ArcTan[1/z]
has the same effect as ans = ans /. ArcTan -> myarctan
but does not require definition of a new function. This alternative is based on equations 4.236 and 4.239 of the digital revised version of Handbook of Mathematical Functions.
Addendum
In answer to the additional question posed in a Comment below, the corresponding definite integral is given by
(ans /. {x -> 1/2, y -> 1/2}) - (ans /. {x -> 1/2, y -> -1/2}) -
(ans /. {x -> -1/2, y -> 1/2}) + (ans /. {x -> -1/2, y -> -1/2})
One way to approach this is to look for the source of the problem. In this case, the outer integral (on y) is irrelevant to the problem, because even the simpler integral
int = Integrate[(1 + b x)/(1 + e x + I η), {x, -1/2, 1/2},
Assumptions -> {b ∈ Reals, c ∈ Reals, e ∈ Reals, η ∈ Reals, η != 0}]
gives a conditional expression. But now the answer is smaller and easier to see. The answer contains the term
Log[2 - e + 2 I η]
and the condition is that -2 < e < 2
. So what is happening is that you are encountering different branches of the Log function.
You can evaluate this for different branches. For instance, instead of the assumption e ∈ Reals
, use e<-2
, e>2
or e==0
. These all return (nonconditional) answers. The last one is even simple:
1/(1 + I η)
Hopefully these answers can feed back into the original problem with the double integral.