I have these 2 functions, which should give identical answers:
GPrime[x_] := (1/CubeRoot[x]) + 1
GPrime2[x_] := (1/(x^(1/3))) + 1
However, given this:
{GPrime[-8],GPrime2[-8]}
i get 2 different answers:
$$\frac{1}{2} , 1 - \frac{1}{2}(-1)^{2/3}$$
why is the answer not $\frac{1}{2}$ for both functions?
For complex numbers $z^w$ is multivaluated. The principal value of $z^w$ is given by $e^{w \log(z)}$ where the principal branch of $\log$ is taken.
Since Mathematica works with complex numbers by default, then $(-2)^{1/3} = e^{\tfrac{1}{3}\log(-2)} = e^{\tfrac{1}{3}(\log(2) + \pi i)}=2^{1/3}(\frac{1+i\sqrt{3}}{2})$.
But when the base $z$ is negative and the exponent is of the form $w=\frac{1}{2n+1}$ one could prefer to use the real $(2n+1)$-th root of $z$. Mathematica have the convenient function
CubeRootfor the case of cube root andSurdfor a more general case.Mathematica's choice could look weird, but that choice allows the function $z^w$ be treated in a general nice way. For example, for fixed $z$ is a continuous function of $w$, while taking the real roots won't even make sense for most exponents.