To explain the difference between the OP's and QuantumDot's comment examples, consider the V11 automatic exclusions expansions:
Visualization`ExpandExclusions[Re[PolyLog[2, 1/(1 - x)]], {x}, Automatic] (* OP *)
Visualization`ExpandExclusions[Re[Log[1/(1 - x)]], {x}, Automatic] (* comment *)
(*
{{Im[1/(1 - x)] == 0, Re[1/(1 - x)] >= 1}, {1 - x == 0, True}, {1/(1 - x) == 1, True}}
{{Im[1/(1 - x)] == 0, Re[1/(1 - x)] <= 0}, {1 - x == 0, True}, {False, True}}
*)
The first two discontinuities are the same, but the third is different. Moreover, in the OP's case, the third evaluates to 1/0
at the discontinuity x == 1
. This seems to be source of the error message. This could probably be considered a bug, but if you've been around Mathematica long enough, you probably remember when Plot
was always giving Pwer::infy
messages.
Some tests follow below. The {False, True}
in the comment version ex2
is perhaps not a valid exclusion spec, as it seems to turn off exclusions. The third set of exclusions ex3
will show that it is the interaction between the last two exclusions in the OP's PolyLog
example that leads to the error.
ex1 = {{Im[1/(1 - x)] == 0, Re[1/(1 - x)] >= 1}, {1 - x == 0, True}, {1/(1-x) == 1,True}};
ex2 = {{Im[1/(1 - x)] == 0, Re[1/(1 - x)] >= 1}, {1 - x == 0, True}(*, {False, True}*)};
ex3 = {{Im[1/(1 - x)] == 0, Re[1/(1 - x)] >= 1}, {1/(1-x) == 1,True}};
Using the PolyLog
exclusions generates 1/0.
errors; using the Log
exclusions generates no errors:
Plot[Re[Log[1/(1 - x)]], {x, -3, 3}, Exclusions -> ex1] (* 1/0. error *)
Plot[Re[PolyLog[2, 1/(1 - x)]], {x, -3, 3}, Exclusions -> ex2] (* no error *)
Plot[Re[PolyLog[2, 1/(1 - x)]], {x, -3, 3}, Exclusions -> ex3] (* no error *)
Plot[1/(1 - x), {x, -3, 3}, Exclusions -> ex1] (* 1/0. error *)
Some functions must be white-listed:
Plot[x, {x, -3, 3}, Exclusions -> ex2] (* no error *)
Plot[Sin[x], {x, -3, 3}, Exclusions -> ex2] (* no error *)
But the discontinuity does not have to be at x == 1
, for the OP's exclusions to generate a 1/0.
error:
Plot[Tan[x], {x, -3, 3}, Exclusions -> ex1] (* 1/0. error *)
As for a rationale justifying the error message in plotting PolyLog[]
, I am at a loss.
Exclusions
.Try usingExclusions->None
. $\endgroup$ – Carl Woll Mar 23 '17 at 17:27Plot[1/(1 - x), {x, -3, 3}]
or evenPlot[Re[Log[1/(1 - x)]], {x, -3, 3}]
generate errors? $\endgroup$ – QuantumDot Mar 23 '17 at 17:58Exclusions -> 1
also eliminates the warning message and strikes me as easier to understand thanExclusions -> None
$\endgroup$ – Bob Hanlon Mar 23 '17 at 20:57