Cube root of a complex number

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Cube root of a complex number

Post by nullplan »

Hi all,

and now for something completely different. I've been thinking about cubics a lot lately, and tried to work out some cubics by Cardano's method. Not like the computer does, but in a symbolic way. And I keep hitting the snag that if a cubic has three real solutions, then u³, one of the intermediate results, will be a complex number in cartesian form. Now, I want to take its cube root, but I can only get numeric solutions, not symbolic ones, anymore.

I suppose I should explain Cardano's method first. If you have a general cubic equation ax³ + bx² + cx + d = 0, the first thing you do is divide everything by a. Then you have x³ + b'x² + c'x + d = 0. You then perform a substitution x = t - b/3. This results in the equation t³ + pt + q = 0. Which is equivalent to t³ = -pt - q. The genius of Cardano's method is then to substitute t = u + v, so adding two new variables. The left-hand side will then expand to u³ + 3u²v + 3uv² + v³ = (u³ + v³) + 3uv(u + v). But u + v = t, so this means (u³ + v³) + 3uvt = -pt - q. This leads to the equation system:

Code: Select all

I.  u³ + v³ = -q
II. 3uv = -p
After a bit of fiddling this leads to the equation u^6 + qu³ - p³/27 = 0. Which is a quadratic equation in u³. Once I have u³, I can take its cube root to get u. Also the above equation system to get v. Add them together to get t, and then add b/3 to get x. To get the other solutions, multiply u with a cube root of unity and recalculate the other things.

Now, the problem is, even if the actual solutions of the equation are simple, it can be hard to find them this way. In my example, I found that u³ = 10 + i √243. Now, before taking the cube root, I would like to put that into polar form. The radius is simple, and simplifies to 7√7. But the angle is just some arctangent. Probably a transcendental number. Then I take the cube root, which means taking the cube root of the radius, which gives √7, but the angle is just that weird arctangent expression divided by 3. And then I have to calculate the cartesian form again, because I am going to be adding these things together in a bit, and that is where I cannot proceed symbolically.

My program doesn't care, it will just calculate these things numerically, but this leads to numerical error. In my example, it did calculate the roots of 2, 3, and 5 correctly, but gave them each a tiny imaginary component. However, it also calculated that my u and v are numbers that look to me like they are rational if expressed in cartesian form.

I hit upon the idea of drawing a triangle to help me get ahead, but now I have the problem of trisecting an angle in geometry. I'm stuck. And google (or duckduckgo in my case) failed to find the answers I was looking for. Can someone help?
Carpe diem!
sunnysideup
Member
Member
Posts: 106
Joined: Sat Feb 08, 2020 11:11 am
Libera.chat IRC: sunnysideup

Re: Cube root of a complex number

Post by sunnysideup »

I did a quick search for Cardano's formula (https://en.wikipedia.org/wiki/Cubic_equ ... 's_formula).
Assuming your coefficients are real, there is guaranteed to be at least one real solution to your cubic equation. In the article, there is a formula for this real solution (There are cube roots involved, but since everything is real, I assume taking the cube root will be simple). From this real root, it is simple to get the other roots. I'm not sure I understand your question completely... Do you just want a technique to get the cube root of a complex number? Or do you want to solve a cubic equation (with real roots)? If it's the latter, I don't think you need to take the cube root of a complex number. I could be wrong though...

P.S: I just read through the article really quicky, and I assume that your coefficients are real (You say that the equation has 3 real roots, so the coefficients are real). I will try to read more about it when I have time
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Cube root of a complex number

Post by nullplan »

sunnysideup wrote:In the article, there is a formula for this real solution (There are cube roots involved, but since everything is real, I assume taking the cube root will be simple).
Well, almost. The cube root is not even the problem, since all real numbers have a cube root. No, the problem is the square root inside of the thing. It is possible (in fact, extremely possible, namely it happens whenever there are three real roots) that the radicand is negative, thereby turning the result of the square root into an imaginary number. In fact, the radicand of the first cube root is my u³.
sunnysideup wrote:Do you just want a technique to get the cube root of a complex number?
Yes, but the number is given as the solution of a quadratic equation, so it is in Cartesian form. And I want to get a symbolic result, not a numeric one. Numeric is easy, anyone can do that.

As I said, in my example I have u³ = 10 + √243 i. In order to take the cube root, I want to convert this into polar form, but that only gets me u³ = 7√7 exp(i atan(√243 / 10)). The problem is, the cube root will divide the angle by three, and then turning that into Cartesian form again makes me work with the sin(atan(...)/3). And that is not very insightful. I have no way to simplify that. Maybe my geometry is too weak for that.
Carpe diem!
sunnysideup
Member
Member
Posts: 106
Joined: Sat Feb 08, 2020 11:11 am
Libera.chat IRC: sunnysideup

Re: Cube root of a complex number

Post by sunnysideup »

I'm not too familiar with the theory of cubic equations, Galois theory, etc... I just wanted to share this with you however:
When a cubic equation with real coefficients has three real roots, the formulas expressing these roots in terms of radicals involve complex numbers. Galois theory allows proving that when the three roots are real, and none is rational (casus irreducibilis), one cannot express the roots in terms of real radicals.
https://en.wikipedia.org/wiki/Cubic_equ ... _solutions
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Cube root of a complex number

Post by nullplan »

Awesome. So what I'm asking may be impossible. At least in the general case.

I thought about it a bit longer, and managed to refine the question into pure geometry: A right triangle with legs a and b has corner point C at the right angle. The angle between a and the hypotenuse is trisected, and the trisector closest to a meets leg b in point D. What is the length CD in terms of a and b?

Let us first define some more objects. The corner points A and B are opposite of legs a and b, respectively. So, B is the corner at which the angle was trisected. Obviously, since the right angle at C is also a part of it, triangle BDC is also a right triangle. Does that help me at all? Yes it does! The angle DBC is one third of angle ABC. So sin ABC = 3 sin DBC - 4 sin³ DBC = b/√(a² + b²). Gnarglblargl; that is as good as it was before. If I want to solve this for sin DBC, I have to solve a depressed cubic. Which is what I'm currently doing. I'm spinning in circles. Does someone have better geometry skills than me?
Carpe diem!
sunnysideup
Member
Member
Posts: 106
Joined: Sat Feb 08, 2020 11:11 am
Libera.chat IRC: sunnysideup

Re: Cube root of a complex number

Post by sunnysideup »

It's not a question about geometry skills anymore XD... To me, it feels like a thing one can/can't do. Kind of like the Second Law of Thermodynamics - It doesn't say much about what you can do, but what you can't. As my professor says, "A person who works for his entire life to build a heat engine more efficient that the Carnot engine is nothing but a fool" XD. No offence of course :).
linguofreak
Member
Member
Posts: 510
Joined: Wed Mar 09, 2011 3:55 am

Re: Cube root of a complex number

Post by linguofreak »

I think your difficulty may be related to the fact that it is impossible (in the general case) to trisect an angle with a compass and straightedge construction?
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Cube root of a complex number

Post by nullplan »

Maybe, but then I never limited the construction to compass and straightedge. Just because Pythagoras liked to do that doesn't mean I have to do the same. The whole world of possibilities is open to you. My problem is that it appears that in general, not much can be said about the sine/cosine of an angle that is only known to be some arctangent divided by three. However, trying to take the cube root in Cartesian form is also not a whole lot simpler. In fact, it is not simple at all.

In Cartesian form, the cube root of the complex number c + di can be defined as a + bi. Then the following holds:

Code: Select all

c + di = (a + bi)³ = a³ + 3a²bi + 3ab²i² + b³i³ = a³ + 3a²bi - 3ab² - b³i = (a³ - 3ab²) + (3a²b - b³) i
Therefore:
I.  a³ - 3ab² = c
II. 3a²b - b³ = d
And now I only need to solve this system of equations for a and b. Seems like a fun afternoon. I typed this into maxima to have it solved automatically, and now it is calculating. I is still calculating at this point. If a CAS is taking this long I don't like the chances of a human doing this work. Oh god, now it is eating all my RAM. I thought 8 GB was overkill, but now they are gone! BRB.
Carpe diem!
User avatar
Thomas
Member
Member
Posts: 281
Joined: Thu Jun 04, 2009 11:12 pm

Re: Cube root of a complex number

Post by Thomas »

I would need to take some time to dig this further, it is a long time since I did something like this. But your approach of going with polar form seems right to me. BTW it is disputed whether Carden first solved cubic equations, he was the first to publish.

https://www.storyofmathematics.com/16th_tartaglia.html
--Thomas
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Cube root of a complex number

Post by nullplan »

OK, so maxima did not like this system of equations, and in the end failed to solve it. Therefore I don't think I will find any happiness this way, either. If the CAS runs out of memory, what would happen to the human?

So, that's it? You can't symbolically take the cube root of a complex number? Bummer.That means you can never show a solution to be actually real if numeric error creeps in. I am beginning to understand why that method isn't taught in school: Even "simple" equations with only natural roots are a pain to work with.
Thomas wrote: BTW it is disputed whether Carden first solved cubic equations, he was the first to publish.
Yeah, publish or perish. As I know the story, Scipione del Ferro might have been the first to discover the method, but he kept it a secret because this way his job was secured. Niccolo Tartaglia discovered the method concurrently or shortly thereafter, independently, and also kept it secret. By a ruse, Cardano managed to get Tartaglia to tell him the secret, but was sworn to secrecy himself. But then, del Ferro died and Cardano was tasked with administrating his estate (it's a small Italy, I guess). Cardano discovered that del Ferro had known the method as well, and independently of Tartaglia. So now Cardano felt free to publish how to do it by del Ferro's method, since he had only sworn not to publish Tartaglia's method. Tartaglia himself was enraged by the publication and tried to publish his own book, telling the story from his point of view, but it was too late, and the formulas would go down in history as Cardano's formulas.

Luckily none of those bollocks happen anymore. These days we just sue each other into oblivion, much more civilized.
Carpe diem!
linguofreak
Member
Member
Posts: 510
Joined: Wed Mar 09, 2011 3:55 am

Re: Cube root of a complex number

Post by linguofreak »

nullplan wrote:Maybe, but then I never limited the construction to compass and straightedge. Just because Pythagoras liked to do that doesn't mean I have to do the same.
Not explicitly, but the point is that compass and straightedge constructions limit you to a certain set of operations, and depending on what you mean by "symbolically" taking the cube root of a complex number, I have a sneaking suspicion that you're limiting yourself to precisely that set of operations, in which case you won't be able to solve anything that can't be solved with compass and straighedge.

From Wikipedia:
Given a set of points in the Euclidean plane, selecting any one of them to be called 0 and another to be called 1, together with an arbitrary choice of orientation allows us to consider the points as a set of complex numbers.

Given any such interpretation of a set of points as complex numbers, the points constructible using valid straightedge and compass constructions alone are precisely the elements of the smallest field containing the original set of points and closed under the complex conjugate and square root operations (to avoid ambiguity, we can specify the square root with complex argument less than π). The elements of this field are precisely those that may be expressed as a formula in the original points using only the operations of addition, subtraction, multiplication, division, complex conjugate, and square root, which is easily seen to be a countable dense subset of the plane. Each of these six operations corresponding to a simple straightedge and compass construction. From such a formula it is straightforward to produce a construction of the corresponding point by combining the constructions for each of the arithmetic operations. More efficient constructions of a particular set of points correspond to shortcuts in such calculations.
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Cube root of a complex number

Post by nullplan »

linguofreak wrote:Not explicitly, but the point is that compass and straightedge constructions limit you to a certain set of operations, and depending on what you mean by "symbolically" taking the cube root of a complex number, I have a sneaking suspicion that you're limiting yourself to precisely that set of operations, in which case you won't be able to solve anything that can't be solved with compass and straighedge.
I mean, I want a solution consisting of mathematical symbols that actually equals what I am looking for. And no, I don't limit myself to the four basic operations and the square root, you can give me a cube root as well. Or rather: You can give me any polynomial expression.

In my example, I have u³ = 10 + √243 i, and I am looking for u. I know that u is about 2.5 + 0.866024. I can take a reasonable guess that that first number is actually 5/2, but what is that imaginary part? A root of something? A cube root expression? I don't know!
Carpe diem!
quirck
Member
Member
Posts: 42
Joined: Sun Nov 23, 2008 5:56 am
Location: Russia, Saint-Petersburg

Re: Cube root of a complex number

Post by quirck »

Consider a quadratic equation x^2 + ax + b = 0 with roots p and q. Then the quadratic equation with roots p^3 and q^3 will be x^2 + (a^3 - 3ab)x + b^3 = 0.

Take our complex number and its complement: 10 + i sqrt(243) and 10 - i sqrt(243). These are the roots of x^2 - 20x + 343 = 0. So, b^3 = 343, thus, b = 7, and a^3 - 3ab = -20, a^3 - 21a + 20 = 0, this has rational roots that can be found by probing. Take any root, for instance, a = -5. Then we have equation x^2 - 5x + 7 = 0, whence x = 5/2 +- i sqrt(3)/2. This is a cube root of 10 +- i sqrt(243). Other values of a give remaining roots.
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Cube root of a complex number

Post by nullplan »

Thanks, that helps a lot. That is an approach I had not considered. Of course, it means that in order to solve a cubic, I first have to solve a cubic, but still, this transformation might come in handy. In fact, if I'm not mistaken then in the quadratic equation for u³, the constant part is always a cube of a rational number (provided you start with rational coefficients), so the equation for a will always have rational coefficients.
Carpe diem!
Post Reply