1
$\begingroup$

Say I have a number, $x$. How do I go about calculating $x^i$? I've used google to calculate various integers to the $i^{th}$ power, for example, $1^i =1$, $2^i \approx 0.769i + 0.638i$, but how do I calculate these myself?

1 Answers 1

4

Use Euler's formula: $e^{iy} = \cos y + i \sin y$ for real $y$.

If $x$ is positive, then $x= e^{\log x}$, so $x^i=e^{i \log x} = \cos \log x + i \sin \log x$.

If $x$ is negative, then $x=-(-x) = e^{i\pi}e^{\log(-x)}$ and $x^i=e^{-\pi} e^{i \log(-x)} = e^{-\pi}(\cos \log(-x) + i \sin \log(-x))$.