Plotting fractional exponents

85 Views Asked by At

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

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

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

There are 1 best solutions below

0
On
  1. As an experiment, try to enter the functions $f(x)=x^{1/5}$ and then $f(x)=x^{0.2}$ into the graphing program.

The graphing program may use the root-extraction based definition of rational powers (which allows negative bases when the denominator/root index is odd) if you enter the exponentvas a ratio of integers rather than a decimal.

Alternatively, the graphing program may allow negative bases if it can match $0.2$ with the rational number $1/5$. If that happens, it leads to a second experiment:

  1. Test the graphing program with $f(x)=x^{0.3333}$ and then $f(x)=x^{0.3333333333333333333333333}$.

With the usual computational precision the latter exponent should be close enough to $1/3$ so that the program will say it's equal, thus use the cube root extraction and extend the plot to negative bases. I got this second experiment to work with MS Excel.

Have fun!