MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Sum of Products - Complete The Square

  • To: mathgroup at
  • Subject: [mg126698] Re: Sum of Products - Complete The Square
  • From: "djmpark" <djmpark at>
  • Date: Thu, 31 May 2012 02:51:22 -0400 (EDT)
  • Delivered-to:

Thanks for introducing/reminding us of SymmetricPolynomial and the
associated SymmetricReduction. SymmetricReduction is the high tech
generalization of complete the square.

3 x^2 + y^2 + 6 x y;
Total@SymmetricReduction[%, {x, y}] 

2 y^2 + 3 (x + y)^2 

David Park
djmpark at 

From: Bob Hanlon [mailto:hanlonr357 at] 

SymmetricPolynomial, for example,

SymmetricPolynomial[2, {a, b, c}] ==
  Total[Times @@@ Subsets[{a, b, c}, {2}]] // Simplify


SymmetricPolynomial[2, {a, b, c, d}] ==
  Total[Times @@@ Subsets[{a, b, c, d}, {2}]] // Simplify


SymmetricPolynomial[4, {a, b, c, d, e, f}] ==
  Total[Times @@@ Subsets[{a, b, c, d, e, f}, {4}]] // Simplify


Bob Hanlon

On Tue, May 29, 2012 at 5:48 AM, Harvey P. Dale <hpd1 at> wrote:
>        If I have a list and want to sum the products of each possible 
> grouping of two elements in the list, this program will do that:
>                Total[Times @@@ Subsets[{a, b, c}, {2}]]
> Is there any other, shorter, built-in Mathematica object that will 
> produce the same result?
>        Thanks.
>        Harvey

  • Prev by Date: Re: I can not find all the contexts through the command "Contexts[]".
  • Next by Date: Re: Laser Scan Image Acuisition
  • Previous by thread: vector ordering problem
  • Next by thread: solving DE numerically....