Lesson goal: Symmetric Polynomials and Vieta's Formula

Previous: Partial Fractions | Home | Next: Polynomial Roots and Box Volume

A polynomial is called symmetric if swapping any of its variables leaves the polynomial unchanged (for example, $x + y$, $xy$, and $x^3 + y^3$). According to the fundamental theorem of symmetric polynomials, any symmetric expression can be written purely in terms of the elementary symmetric sums: $$s_1 = x + y \quad \text{and} \quad s_2 = xy$$ In the 1966 MAA High School Mathematics Contest (Problem #10), contestants were asked: If the sum of two numbers is 1 ($x + y = 1$) and their product is 1 ($xy = 1$), then what is the sum of their cubes ($x^3 + y^3$)? If you tried to solve for $x$ and $y$ directly, you would find complex numbers ($x = \frac{1 + i\sqrt{3}}{2}, y = \frac{1 - i\sqrt{3}}{2}$). Instead of dealing with complex arithmetic, we can use the algebraic expansion: $$(x + y)^3 = x^3 + 3x^2 y + 3xy^2 + y^3 = (x^3 + y^3) + 3xy(x + y)$$ Rearranging gives the symmetric identity: $$x^3 + y^3 = (x + y)^3 - 3xy(x + y)$$ In this lesson, we will use CodeByMath's symbolic expand function to manipulate symmetric expressions and verify the contest answer!
identity = expand("(x + y)^3 - 3*x*y*(x + y)")
sum_cubes = s1^3 - 3 * s2 * s1
Move the mouse over a dotted box for more information.

Substituting $s_1 = 1$ and $s_2 = 1$ directly into the identity: $$x^3 + y^3 = 1^3 - 3(1)(1) = 1 - 3 = -2$$ The imaginary parts completely cancel out!

Now you try. Replace ???? with s1^3 - 3 * s2 * s1. Run the code to verify that the sum of cubes equals $-2$, matching choice (E) from the contest!

Type your code here:


See your results here: