Here's the domain of the function:
When I'm trying to plot it Mathematica just shows a graph of $x+1$.
Here's what happens if we put $x$ in formula from outside of a function's domain:
I'm not sure whether it's a bug or Mathematica simplifies the equation to $x+1$ but I'm searching for a way to plot it correctly. Any help would be appreciated!
x^Log[x, x + 1]
Mathematica returns1 + x
. So I think it's a simplification thing. You could usePlot[x^Log[x, x + 1], {x, -5, 5}, RegionFunction -> Function[{x}, 0 < x < 1 || x > 1]]
to get it plotting over the domain you want. $\endgroup$ – aardvark2012 Dec 21 '17 at 20:34Log[-5, -4] // N -> 0.971177 + 0.0562626 I
then(-5)^(0.971177 + 0.0562626 I) -> -4+eps I
$\endgroup$ – george2079 Dec 21 '17 at 20:51Log
should be real:Plot[x^Re[Log[x, x + 1]], {x, -5, 5}]
, although it is not quite the same. $\endgroup$ – yarchik Dec 21 '17 at 20:53FunctionDomain
is the whole real axis. Maybe you are concerned that intermediate steps are only possible in your domain. However, this is not right mathematical logic: have a look at $sin(x)=(e^{ix}+e^{-ix})/2i$---the result is real although each exponent is complex for each real $x$. $\endgroup$ – yarchik Dec 21 '17 at 21:13x^Log[x, x + 1]
expression to1 + x
is "generically correct" forPower
andLog
as functions of complex arguments, which is how they are defined in Mathematica. You could use myRestrictDomain
function:RestrictDomain[x^Log[x, x + 1], x, Reals]
to get expression with domain restriction, assuming all functions are restricted toReals
. $\endgroup$ – jkuczm Dec 22 '17 at 20:46