$x^y = \exp( \ln(x) \cdot y )$, not a real solution for decimal numbers?

227 Views Asked by At

I am trying to understand how to calculate $x^y$ where $y$ is a decimal number, ($2^{2.3}$)

According to wikipedia, the 'solution' would be

$$ x^y = \exp( \ln(x) \cdot y ).$$

But if we break it down further,

$$\begin{align} z &= \ln(x) \cdot y\\ x^y &= \exp( z )\end{align}$$

But in that case, $z$ is almost certainly not going to be an round number itself.

So to calculate

$$ x^y = \exp( z )$$

I would need to do

$$ x^y = \exp( \exp( \ln(e) \cdot z ) )$$

So this is never really going to end ...

While I understand that the number can have an infinite number of decimals, I was wondering if using logarithm to calculate numbers raised to decimal numbers.

What is the best way to calculate $x^y$ where $y$ is a decimal, (without a calculator :))

2

There are 2 best solutions below

2
On BEST ANSWER

May be something such as $$z=x^y=x^{\lfloor y\rfloor }\times x^{y-\lfloor y\rfloor }=x^{\lfloor y\rfloor }\times e^{(y-\lfloor y\rfloor)\log(x)} $$ followed by the use of truncated Taylor series for the last term (this will converge quite fast since the exponent is made much smaller). Here $\lfloor \cdot \rfloor$ is the floor function.

For example $2^{2.3}=2^2\times 2^{0.3}=4\times e^{0.3\log(2)}\approx 4\times e^{0.208}$.

Now, limited to three terms $$e^{0.208}\approx1+\frac{0.208}{1!}+\frac{(0.208)^2}{2!}+\frac{(0.208)^3}{3!}\approx 1.231132 $$ which makes $2^{2.3}\approx 4.92453$ while the exact value should be $\approx 4.92458$.

Truncating even more, that is to say using $0.2$ instead of $0.208$ would lead to a value of $4.88533$ that is to say within an error of $1$% which is more than acceptable for something done by hand.

0
On

Your "problem" is that you view the function $x\mapsto \exp(x)$ as exponentiation, i.e., as raising a certain number $e$ to the $x$th power. This probably comes from the widespread (abuse of) notation $e^x$ instead of $\exp(x)$ for the exponential function. :)

Instead view $\exp$ as the function defined in one of varios ways, for example $$\exp(x):=\sum_{k=0}^\infty\frac{x^k}{k!} $$ or $$ \exp(x):=\lim_{n\to\infty}\left(1+\frac xn\right)^n$$ or as the unique(!) functon $f$ with the properties $$ f'(x)=f(x),\qquad f(0)=1.$$ After that observe that one can show $\exp(x+y)=\exp(x)\exp(y)$ for all $x,y$, which a posteriori justifies $\exp(x)=\exp(1)^x$ (and of course $e=\exp(1)$).