Viètas Formulas

Author

Eric W. Weisstein
April 14, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Algebra/VietasFormulas.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/VietasFormulas.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

SetOptions[Roots,Cubics->False,Quartics->False]

VietasFormulas[p_,x_]:=Module[{
c=CoefficientList[p,x],r=x/.{ToRules[Roots[p==0,x]]},
n=Exponent[p,x],k
},
Plus@@@Apply[Times,Map[r[[#]]&,
Table[KSubsets[Range[n],k],{k,n}],
{3}],{2}]
]

Examples

Simplify@VietasFormulas[Plus@@(a[#]x^#&/@Range[0,2]),x]

RootReduce[
Simplify@VietasFormulas[Plus@@(a[#]x^#&/@Range[0,3]),x]
]

RootReduce[
Simplify@VietasFormulas[Plus@@(a[#]x^#&/@Range[0,4]),x]
]

RootReduce[
Simplify@VietasFormulas[Plus@@(a[#]x^#&/@Range[0,5]),x]
]

RootReduce[
Simplify@VietasFormulas[Plus@@(a[#]x^#&/@Range[0,10]),x]
]