1
$\begingroup$

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?

$\endgroup$
2
  • 1
    $\begingroup$ 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. $\endgroup$
    – MarcoB
    Aug 2 at 18:43
  • 1
    $\begingroup$ A function for ReImPlot[]. $\endgroup$ Aug 2 at 19:10

1 Answer 1

3
$\begingroup$
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}]

enter image description here

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

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

enter image description here

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}]

enter image description here

The two functions are equal in their common domain

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

(* True *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.