1
$\begingroup$

assuming $Z$ is a complex number i.e $a + bi$. we have

$Z^2 = (a + bi)^2 = (a^2-b^2)+(2ab)i$

$Z^3 = (a+bi)^3 = (a^3-3ab^2) - (b^3-3a^2b)i$

but what would be the general formula for computing $Z^n$ where n is any real number?

I wanted to use this method but i dont know how the computation goes for complex number $i$. also I want to do this computation on a computer so i have to keep real and imaginary parts separated from each other.

I know that i can only approximate numbers when $n$ is not an integer. but thats ok.

Is this even possible?

$\endgroup$
  • $\begingroup$ You can get these by using the binomial theorem. $\endgroup$ – Lord Shark the Unknown Apr 20 '18 at 17:47
  • 3
    $\begingroup$ Use the polar form of the complex numbers $\endgroup$ – Andrei Apr 20 '18 at 17:48
  • $\begingroup$ sorry the link was broken. fixed it. $\endgroup$ – M.kazem Akhgary Apr 20 '18 at 17:48
  • $\begingroup$ @Andrei good idea. i totally forgot that, thanks. $\endgroup$ – M.kazem Akhgary Apr 20 '18 at 17:51
1
$\begingroup$

If, when you say "I want to use this method", you mean that you really want to use the binomial expansion, rather than using polar form, then $(a+ ib)^n$ will be a sum of monomials of the form $\frac{a^(n-i)(ib)^i}{i!}$. "i" has "period 4". That is $i^1= i$, $i^2= -1$, $i^3= -1$, and $i^4= 1$ so that further powers are just repeats of that. You can separate that into one real part which will have powers that are multiples of 4 another subtracted with powers that are two more than multiples of 4, an imaginary part of two parts, the first with powers that are 1 more than multiples of 4, the second, subtracted with powers that are three more than powers of 4 : $\left(a^n+ \frac{a^{n-4}b^4}{4!}+ \frac{a^{n-8}b^8}{8!}+ \cdot\cdot\cdot+\frac{a^{n-4k}b^{4k}}{4k!}+ \cdot\cdot\cdot\right)- \left(a^{n-2}b^2+ \frac{a^{n- 6}b^6}{6!}+ \frac{a^{n-10}b^{10}}{10!}+ \cdot\cdot\cdot+\frac{a^{n-4k- 2}b^{4k+2}}{(4k+2)!}+ \cdot\cdot\cdot\right)+ i\left(a^{n-1}+ \frac{a^{n-5}b^5}{5!}+ \frac{a^{n-9}b^9}{9!}+ \cdot\cdot\cdot+\frac{a^{n-4k-1}b^{4k+1}}{(4k+1)!}+ \cdot\cdot\cdot\right)- i\left(a^n+ \frac{a^{n-4}b^4}{4!}+ \frac{a^{n-8}b^8}{8!}+ \cdot\cdot\cdot+\frac{a^{n-4k-3}b^{4k+3}}{(4k+3)!}+ \cdot\cdot\cdot\right)$.

$\endgroup$
  • $\begingroup$ in my program i had to use $atan2$ instead of $atan$ but that totally worked. $\endgroup$ – M.kazem Akhgary Apr 20 '18 at 18:45
  • $\begingroup$ your previous answer was the one that helped me. please keep that (as well as this if you want.) thanks for the effort. and sorry i really didnt know the main solution. polar form that you provided was much simpler to achieve. $\endgroup$ – M.kazem Akhgary Apr 20 '18 at 18:48
  • $\begingroup$ enjoy :) you can set the power to a constant value as well. glslsandbox.com/e#46501.8 $\endgroup$ – M.kazem Akhgary Apr 20 '18 at 18:58
1
$\begingroup$

For $z=r(\cos\phi+i\sin\phi)$, where $r=\sqrt{a^2+b^2}$, $\cos\phi=\frac{a}{r}$, $\sin\phi=\frac{b}{r}$ we have $$ z^n=r(\cos n\phi+i\sin n\phi) $$ It is a basic method.

$\endgroup$
  • $\begingroup$ never thought it would be this easy. thanks a lot $\endgroup$ – M.kazem Akhgary Apr 20 '18 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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