# Finding real and imaginary part with polar coordinates

I'm stuck with a really basic problem, and would appreciate help to understand what I am doing wrong.

The task is to find imaginary and real part of $$\Big(\frac{-1+ i \sqrt{3}}{2}\Big)^3$$

Solution so far:

$$z^n=re^{i \theta n}$$

$$r=|z| = \sqrt{\frac{1}{4}+\frac{3}{4}}=1$$

$$\theta = \arg(z)=\arctan\Big(\frac{y}{x}\Big)=\arctan\Big(\frac{\sqrt{3}/2}{-1/2}\Big)=\frac{-\pi}{3}$$

Which gives me that $$\displaystyle z^n=re^{i \theta n} = e^{-i\frac{3\pi}{3}} = e^{-i\pi}$$

The correct answer is $$e^{i\frac{2\pi}{3}}$$

What in the calculation of $$\theta$$ am I doing wrong?

Thanks!

• You have $\theta = \arctan(y/x)$ only if $x+iy$ lies in the 1st or 4th quadrants. The angle you want is $-\pi/3+\pi.$ Jul 14, 2023 at 11:37
• $~\theta = 2\pi/3,~$ rather than $~-\pi/3.$ Jul 14, 2023 at 11:37
• In general, I recommend against attempting to use the ArcTan function to determine $~\theta,~$ (within a modulus of $~2\pi~$), because it involves special rules. The (alternative) approach that I use is that $~\theta~$ is uniquely defined (within a modulus of $~2\pi~$) by the values of $~\sin(\theta)~$ and $~\cos(\theta).~$ In the specific posted question, since $~\sin(\theta) > 0, ~$ and $~\cos(\theta) < 0,~$ you must have that $~\theta~$ is in the second quadrant. Jul 14, 2023 at 11:42
• That result of $\arctan$ is formally correct but $z$ lies in the second quadrant, and you should measure $\theta$ counter clockwise from the $x$-axis. Another hint: neither your $e^{-i\pi}$ nor that $e^{i2\pi/3}$ is correct. Jul 14, 2023 at 12:00

The angle is in the second quadrant because real part is negative and imaginary part is positive, so can be represented by a complex number

$$r= e^ {i \frac{2 \pi}{3}}$$

$$r^3 =(e^ {i \frac{2 \pi}{3}} )^3=e^{2\pi i}= 1= 1+0i$$ which is the pure real number unity by Euler formula with zero imaginary part.

The tip of radius vector is 1 unit away from origin on the positive real axis.

Geometrically if 3 copies are made of the angle rotation amount in counterclockwise direction the vector tip lands at $$(1,0)$$.

There are two issues:

Firstly, $$\arctan (-\sqrt{3}) = -\frac{\pi}{3}$$, not $$-\frac{\pi}{6}$$ (perhaps you computed $$\arctan\left(-\frac{1}{\sqrt{3}}\right)$$ instead).

Secondly, $$\arctan\frac{y}{x}$$ only yields the argument of values with real positive part (and then provided that the branch of the argument has range containing the image $$\left(-\frac\pi2, \frac\pi2\right)$$ of $$\arctan$$). For points $$x + i y$$ with negative real part $$x$$, we can compute the argument with the formula $$\arg (x + i y) = \arctan\frac{y}{x} + \pi$$ (and then adding an integer multiple of $$2 \pi$$ if the choice of branch of $$\arg$$ makes it necessary). In our case, any branch will do, so we can take, e.g., $$\arg \frac{-1 + \sqrt{3}}{2} = \arctan \frac{\frac{\sqrt{3}}{2}}{\frac{-1}{2}} + \pi = \frac{2 \pi i}{3}.$$ Since the radial coordinate of $$\frac{-1 + \sqrt{3}}{2}$$ is $$1$$, $$\frac{-1 + \sqrt{3}}{2} = e^{2 \pi i / 3} .$$

Cf. atan2.

• Thanks for your comment! So I have one more question. Do I always just add $\pi$ to my given $\arctan(y/x)$ when I see I have a negative real part? Or are there any cases where I don't add $\pi$? And the reason for that is that the input for $\tan$ is where there are positive real value, so we simply want to be on that side?
– uoiu
Jul 14, 2023 at 11:49
• @uoiu The main principle you should follow is that $\theta$ is the counter clockwise angle from the $x$-axis. Unless I am writing a computer program I usually refrain from following mechanically what $\arctan$ et.al. are telling me. I sanity check my results with the mentioned principle. Jul 14, 2023 at 12:27
• @uoiu Kurt G.'s explanation is how I suggest thinking about argument, too. That quantity is exactly what $\arctan \frac{y}{x}$ measures---but only for values with positive real part $x$. You can always check that your polar form is correct (and in particular that your argument is correct, at least up to integer multiples of $2 \pi$) by converting back to rectangular coordinates, i.e., by verifying that $x = r \cos \theta$ and $y = r \sin \theta$. Jul 14, 2023 at 13:02
• @uoiu Consider the case $x<0, y<0$, that is you are in the third quadrant. Then $\arctan(y/x)>0$ and you have to subtract $\pi$ to get the principal angle (i.e. in $(-\pi,\pi)$). Just remember a tangent only allows to know an angle up to a multiple of $\pi$, then look at what you get with $\arctan (y/x)$, and "where it should be". Jul 14, 2023 at 13:39

You have chosen the wrong quadrant. Recall that the tangent function is negative in Quadrants $$2$$ and $$4$$, while positive in Quadrants $$1$$ and $$3$$.

By principal arguments,

$$0 < \theta < \pi/2, \quad \text{Quad } 1 \\\pi/2 < \theta < \pi, \quad \text{Quad } 2 \\-\pi/2 < \theta < 0, \quad \text{Quad } 4 \\-\pi < \theta < -\pi/2, \quad \text{Quad } 3$$

By your output of $$\theta = -\pi/3$$, this angle exists in Quadrant $$4$$. However, taking a closer looking at $$z$$, we realise $$\Re{(z)} = r\cos{\theta} = -1/2 < 0$$.

But, in Quadrant $$4$$, $$\cos{\theta} > 0$$. (This type of error can also be identified by $$\Im{(z)} = r\sin{\theta}$$). Hence, your angle should be in Quadrant $$2$$, where $$\cos{\theta} < 0$$, which indeed is $$2\pi/3$$.

For your reference, a computation trick is to observe

$$(\frac{-1}{2}, \frac{\sqrt{3}}{2})$$ should be in 2nd Quadrant.

So $$\pi/2 \leq \theta \leq \pi$$.

Then you will know that you need to add $$\pi$$ to $$\frac{-\pi}{3}$$.