Ask Your Question

coconuts's profile - activity

2015-05-11 19:30:22 +0200 commented answer Demonstrating Cubic Formula to a Student

Thanks for the help! As you can see, I'm quite new at this. Is there anywhere I can get a "birds eye view" of the whole API? The documentation seems cluttered with test cases...

2015-05-11 13:36:30 +0200 asked a question Demonstrating Cubic Formula to a Student

I'm trying to demonstrate the Lagrange approach to solving a cubic to a student.

w = CyclotomicField(3).gen()
x0 = var('x0')
x1 = var('x1')
x2 = var('x2')
s0 = x0 + x1 + x2
s1 = x0 + x1*w + x2*w^2
s2 = x0 + x1*w^2 + x2*w

After expanding s1^3 + s2^3, the output is cluttered with cube roots of unity (these _should_ cancel out).

I would like to treat w abstractly, where the only relevant constraints are w^2 + w + 1 == 0 and w^3 == 1.

When simplifying, I would like it to collect all coefficients of powers of w and automatically apply the above rules (e.g: w^2 + w == -1).

Or -- is there some other way to do this?

Specifically, at least for the sake of readability, I would like to the roots to be represented only by w.