Why Is My Argument Calculation for Complex Number Incorrect?

In summary, the article explores common reasons why calculations involving complex numbers may yield incorrect arguments. It highlights potential pitfalls such as misunderstanding the polar form, miscalculating angles, or overlooking the periodic nature of trigonometric functions. Additionally, it emphasizes the importance of correctly interpreting the argument's range and ensuring proper handling of both the real and imaginary components in calculations.
  • #1
MatinSAR
612
188
Homework Statement
Stated below.
Relevant Equations
Complex algebra.
Question 1: Find the modulus and argument of ##z=-\sin \frac {\pi}{8}-i\cos \frac {\pi}{8}##.
The modulus is obviously 1. I can't prove that the argument is ##\frac {-5\pi} {8}##. I think ##\frac {-5\pi} {8}## is not correct ...

What I've done:
$$\tan \theta=\cot \frac {\pi}{8}$$$$\tan \theta=\dfrac {1+\cos \frac {\pi}{4}}{\sin \frac {\pi}{4}}$$$$\tan \theta=1+ \sqrt 2$$$$\theta=\arctan (1+ \sqrt 2) +2k\pi$$
I can't find out why it should be equal to ##\frac {-5\pi} {8}##.

Question 2: Calculate ##(-1+i\sqrt 3)^{60} ##.
We first write it in polar form ##re^{i\theta}##.
$$r=2$$$$\tan \theta = -\sqrt 3 $$$$ \theta = \dfrac {2\pi}{3}$$
We have:
$$ (2e^{i(\dfrac {2\pi}{3})})^{60} =2^{60}e^{i(40\pi)}=2^{60}(\cos 40\pi + i\sin 40\pi)=2^{60}$$
Am I right?

Many thanks.
 
Physics news on Phys.org
  • #2
I've checked 2nd question using Microsoft Copilot. It was correct. I did not expect that it can calculate things like this ...
 
  • #3
MatinSAR said:
it can calculate things like this

And it can also calculate ##\arctan\bigl (-\cos({\pi\over 8})/-\sin({\pi\over 8})\bigr ) ## I suppose

But a simple sketch of ##z## on the unit circle will help you better :smile:

##\ ##
 
  • Like
  • Haha
Likes WWGD, PeroK, MatinSAR and 1 other person
  • #4
For another approach, which I think is simpler, try to relate ##z=-\sin(\frac {\pi}{8}) -\cos(\frac {\pi}{8})## to ##e^{i\frac{\pi}{8}} = \cos(\frac {\pi}{8}) +i \sin(\frac {\pi}{8})##.
 
  • Like
Likes MatinSAR
  • #5
For (1), note that [itex]-z = \sin \frac\pi 8 + i\cos \frac \pi 8[/itex].
Note also that [tex]\begin{split} \cos \theta &= \sin (\frac12\pi - \theta) \\
\sin \theta &= \cos(\frac12\pi - \theta).\end{split}[/tex] Hence [itex]\sin \frac\pi 8 + i \cos \frac \pi 8 = \cos \frac {3 \pi} 8 + i \sin \frac {3\pi}8[/itex].
 
  • Like
Likes MatinSAR
  • #6
BvU said:
And it can also calculate ##\arctan\bigl (-\cos({\pi\over 8})/-\sin({\pi\over 8})\bigr ) ## I suppose

But a simple sketch of ##z## on the unit circle will help you better :smile:

##\ ##
I've asked first question but the answer was unreadable since my android device doesn't support latex.
FactChecker said:
For another approach, which I think is simpler, try to relate ##z=-\sin(\frac {\pi}{8}) -\cos(\frac {\pi}{8})## to ##e^{i\frac{\pi}{8}} = \cos(\frac {\pi}{8}) +i \sin(\frac {\pi}{8})##.
Thanks for your idea. I'll try.
pasmith said:
For (1), note that [itex]-z = \sin \frac\pi 8 + i\cos \frac \pi 8[/itex].
Note also that [tex]\begin{split} \cos \theta &= \sin (\frac12\pi - \theta) \\
\sin \theta &= \cos(\frac12\pi - \theta).\end{split}[/tex] Hence [itex]\sin \frac\pi 8 + i \cos \frac \pi 8 = \cos \frac {3 \pi} 8 + i \sin \frac {3\pi}8[/itex].
Great! I've understand. Many thanks.
 
  • #7
MatinSAR said:
I can't find out why it should be equal to ##\frac {-5\pi} {8}##.
The trig functions are not 1:1 on the range ##[0, 2\pi]##, so you must take note of what quadrant the number is in. With this step you have already lost that information:
MatinSAR said:
What I've done:
$$\tan \theta=\cot \frac {\pi}{8}$$
 
  • Like
Likes MatinSAR
  • #8
MatinSAR said:
I've asked first question but the answer was unreadable since my android device doesn't support latex.

Thanks for your idea. I'll try.

Great! I've understand. Many thanks.
I have an Android too, and no problem with Latex. As I understand, the rendering is done in PF itself, not your browser.
 
  • Like
Likes MatinSAR
  • #9
PeroK said:
The trig functions are not 1:1 on the range ##[0, 2\pi]##, so you must take note of what quadrant the number is in. With this step you have already lost that information:
I'm not sure If I understand your point well. I know from it's cartesian form that it is in 3rd quadrant.
Can't I change that equation to ##\tan \theta = \cot (\pi + \dfrac {\pi} {8})##?
WWGD said:
I have an Android too, and no problem with Latex. As I understand, the rendering is done in PF itself, not your browser.
I don't have problem in PF. In Bing app it doesn't render correctly.
 
  • Like
Likes WWGD
  • #10
MatinSAR said:
I've asked first question but the answer was unreadable since my android device doesn't support latex.
here's another crutch :rolleyes:

##\ ##
 
  • Like
Likes MatinSAR
  • #11
MatinSAR said:
I'm not sure If I understand your point well.
I know from it's cartesian form that it is in 3rd quadrant. Can't I change that equation to :
$$\tan \theta = \cot (\pi + \dfrac {\pi} {8}) $$

I don't have problem in PF. In Bing app it doesn't render correctly.
It doesn't matter. You start with a specific complex number, but when you calculate ##\tan \theta## you have two possible complex numbers that satisfy that equation. You can never recover ##z## from that equation without additional information.

The complex plane/argand diagram is invaluable. And you should use it as much as possible.
 
  • Like
Likes MatinSAR
  • #12
BvU said:
Now it is clear. Thanks for your help @BvU ...
I was using google calculator and it didn't gave exact value ... I will use wolframalpha.com from now.
PeroK said:
It doesn't matter. You start with a specific complex number, but when you calculate ##\tan \theta## you have two possible complex numbers that satisfy that equation. You can never recover ##z## from that equation without additional information.

The complex plane/argand diagram is invaluable. And you should use it as much as possible.
A bit complicated.
Are you saying that ##\tan \theta = X## has two answers?
That one of them is ##\arctan X## and the other one is ##\arctan X + \pi ## ...
Did I understand your idea correctly?
 
  • #13
MatinSAR said:
Now it is clear. Thanks for your help @BvU ...
I was using google calculator and it didn't gave exact value ... I will use wolframalpha.com from now.

A bit complicated.
Are you saying that ##\tan \theta = X## has two answers? And one of them is ##\arctan X## and the other one is ##\arctan X + \pi ## ...
It has infinitely-many, unless you restrict the range of values for ##X##, given ##arctanX ## is periodic.
 
  • Like
Likes MatinSAR
  • #14
MatinSAR said:
Are you saying that ##\tan \theta = X## has two answers? And one of them is ##\arctan X## and the other one is ##\arctan X + \pi ## ...
Yes. All three basic trig functions are 2:1 on the interval ##[0, 2\pi)##. In general:
$$\sin^{-1}(\sin x) \ne x \ \ (x \in [0, 2\pi))$$etc.
 
  • Like
Likes MatinSAR
  • #15
WWGD said:
It has infinitely-many, unless you restrict the range of values for ##X##, given ##arctanX ## is periodic.
PeroK said:
Yes. All three basic trig functions are 2:1 on the interval ##[0, 2\pi)##. In general:
$$\sin^{-1}(\sin x) \ne x$$etc.
I understand now. Thanks for your time.


Thank you to everyone for his help.
 
  • Like
Likes BvU, berkeman, WWGD and 1 other person

FAQ: Why Is My Argument Calculation for Complex Number Incorrect?

Why is my argument calculation for a complex number returning the wrong angle?

The argument of a complex number can be tricky due to the periodic nature of trigonometric functions. Ensure you are using the correct quadrant for the angle. Many programming languages have functions like `atan2(y, x)` that take into account the signs of both the real and imaginary parts to return the correct angle.

Could rounding errors be affecting my argument calculation?

Yes, rounding errors can affect the precision of your argument calculation. Computers have finite precision, and small errors in the real or imaginary parts of the complex number can lead to noticeable differences in the argument. Use higher precision arithmetic if necessary.

Am I using the correct formula to calculate the argument of a complex number?

The argument θ of a complex number z = x + yi is given by θ = atan2(y, x). Ensure you are not using atan(y/x) directly, as this does not account for the correct quadrant and can lead to incorrect results.

Why is my argument calculation off by π or 2π?

This discrepancy often occurs because the argument of a complex number is periodic with a period of 2π. Ensure that your calculation correctly accounts for this periodicity and that you are normalizing the angle to the desired range, typically between -π and π or 0 and 2π.

How can I verify the correctness of my argument calculation?

To verify your calculation, compare the result with known values for specific complex numbers. For example, the argument of 1 + i is π/4, and the argument of -1 + i is 3π/4. Cross-check your results with these known values or use a reliable mathematical software for verification.

Back
Top