
How can i use the roots function to show that all the roots of a complex number lie on a circle.
8 views (last 30 days)
Show older comments
The question gives the following information: Given z=1+3i , what is z^1/4 where arg(z) is in the range: pi/2 < arg(z) < pi I am looking how i would go about using the roots function to solve the problem and how i would find the other roots to generate a figure which shows that all the roots lie on a circle in the complex plane. My code so far without using the roots function:z = 1+3i; Im = imag(z); Re = real(z); Mag = abs(z); theta = atan(Im/Re); %more data of powers n = 1/4; k = 1:4; arg = (theta*n + (2*k*pi)*n) x = cosd(arg); y = 1i*sind(arg); r = Mag.^(n); zn = r.*(x) + r.*(y); zn = zn' Any advice would be greatly appreciated.
0 Comments
Accepted Answer
John D'Errico
on 11 Dec 2016
Edited: John D'Errico
on 12 Dec 2016
Well, you did make an effort. Something we see too little of from students lately. :)
You want to find the 4 roots of a complex number.
z = 1+3i;
Just use roots, on the polynomial
x^4 - z == 0
Clearly, any solutions to that equation must be roots of z. That takes no more than
format long g
r = roots([1 0 0 0 z])
r =
-1.18702520404887 + 0.607659917216594i
-0.607659917216594 - 1.18702520404886i
0.607659917216592 + 1.18702520404886i
1.18702520404886 - 0.607659917216592i
We can view those numbers in polar form. The radial component would be:
abs(r)
ans =
1.33352143216333
1.33352143216332
1.33352143216332
1.33352143216332
That is consistent with this prediction:
nthroot(abs(z),4)
ans =
1.33352143216332
Are they on a circle? Of course.
plot(real(r),imag(r),'bo')
axis equal
grid on
r1 = abs(r(1));
t = linspace(0,2*pi,100);
hold on
plot(r1*cos(t),r1*sin(t),'r-')

Note that axis equal was important there, otherwise the plot would look elliptical.
If you want to convince yourself the points are equally spaced around the circle, try this:
(angle(r) - min(angle(r)))/pi
ans =
1.5
0
1
0.5
So the differences between each point in angle is a nice simple multiple of pi.
One caveat to remember: this exposition using roots shows only that the roots of THIS PARTICULAR complex number lie on a circle. While we know it to be true in general, this is not a proof of the general case.
5 Comments
John D'Errico
on 13 Dec 2016
Why would I have calculated the 4th root of z^(1/4)??? I think you are getting confused. Start over.
Surely z^(1/4) is the 4th root of z, which is what you were looking for?
I calculated the solutions to the problem x^4-z==0. If x is such a solution, then it MUST be one of the 4th roots of z, since
(z^(1/4))^4 = z
free5721
on 23 May 2023
If trying to find the 4th roots of z, the expression "roots([1 0 0 0 z])" as shown in the example should be "roots([1 0 0 0 -z])"
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!