# Negative numbers raised to a fraction [closed]

I came across this function to solve for x (answers are -27, 0, 1)

x^(5/3)+2*x^(4/3)-3*x;


I went out to Desmos and Geogebra to graph it and the graph shows the curve correctly from x=-30 to x=30.

For fun, I converted it to postfix notation

x 5 3 / ^ 2 x 4 3 / ^ * + 3 x * -


and wrote a java program to calculate values in the above range.

However, when running it, I get Not-a-number for negative values of x.

Calculating -1^(4/3) reports NAN in Excel and other online exponential calculators. In Java,

double x = Math.pow(-1.0, 5.0/4);


returns NAN.

I understand complex numbers so my question is, how is it that these graphing programs manage to avoid the occurrence of NAN's and are able to draw the graph?

• 1. This site is about Wolfram Mathematica. Are you looking for the general math forum at math.stackexchange.com? 2. When you say to "solve for x", I assume that you mean to solve the equation yourExpression == 0 for values of x. If that's true, then note that the only roots are 0 and 1; -27 is not a root. Aug 2 at 18:43
• A function for ReImPlot[]. Aug 2 at 19:10

f1[x_] = x^(5/3) + 2*x^(4/3) - 3*x;

Solve[f1[x] == 0, x]

(* {{x -> 0}, {x -> 1}} *)


f1 is only real-valued for x >=0

FunctionDomain[f1[x], x]

(* x >= 0 *)

Plot[f1[x], {x, -2, 5}]


You apparently want the real-valued cube root (see Surd)

f2[x_] = Surd[x^5, 3] + 2*Surd[x^4, 3] - 3*x


Solve[f2[x] == 0, x]

(* {{x -> -27}, {x -> 0}, {x -> 1}} *)


f2 is real valued for all real x

FunctionDomain[f2[x], x]

(* True *)

Plot[f2[x], {x, -30, 5}]


The two functions are equal in their common domain

Assuming[x >= 0, f1[x] == f2[x] // Simplify]

(* True *)