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:
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?