       Re: Re: question 1

• To: mathgroup at smc.vnet.net
• Subject: [mg75919] Re: [mg75873] Re: [mg75810] question 1
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Sun, 13 May 2007 05:50:31 -0400 (EDT)
• References: <200705110924.FAA05900@smc.vnet.net> <A52D6750-3017-4EF6-82F7-DFE4CB83812F@mimuw.edu.pl> <CB1CAE8E-3B30-4645-9279-14C936512446@mimuw.edu.pl> <3201069.1178958084224.JavaMail.root@m35> <op.tr8whmu1qu6oor@monster.ma.dl.cox.net>

```This is of course the right approach when you know you have a "power
sum" and want to find a suitbale representation. However, if you
wanted to use this as a posssible transofrmation for Simplify it
would not be much use since, while:

powerSum[Expand[(x - 2)^4 + (y + 3)^5], {x, y}]
y + 3)^5 + (x - 2)^4

works nicely,

powerSum[Expand[(x - 2)^4 + (y + 3)^5] + 11, {x, y}]

is a disaster.

Note that with:

transf[f_, {e_, o_}] :=
With[{a = Integrate[D[f, e], e], b = Integrate[D[f, o], o]},
FullSimplify[Simplify[a] + Simplify[b] + Simplify[(f - (a + b))],
ExcludedForms -> {(e + c_)^n_, (o + d_)^m_}]]

we get

transf[Expand[(x - 2)^4 + (y + 3)^5] - 11, {x, y}]
(y + 3)^5 + (x - 2)^4 - 11

and even when we have cross terms, the answer returned is often
better than that returend by FullSimplify:

a = transf[Expand[(x - 2)^4 + (y + 3)^5] + x*y, {x, y}]

(y + 3)^5 + x*(x*((x - 8)*x + 24) + y - 32) + 16

b = FullSimplify[Expand[(x - 2)^4 + (y + 3)^5] +  x*y]

x^4 - 8*x^3 + 24*x^2 + (y - 32)*x + y*(y*(y*(y*(y + 15) + 90) + 270)
+ 405) + 259

LeafCount /@ {a, b}
{21, 37}

My own intention was not so much to find a way of expressing a given
expression as a sum of powers when we know that it cna be so
expressed as to find a transformation that might be added to the
transformations used by Simplify and that would help it to find such
representations when they existed and would return something
reasonably simple (better than FullSimplify does by default) in other
cases.
Of course I don't really think this project is practical because of
the high complexity any such transformation would probably have to have.

Andrzej Kozlowski

On 13 May 2007, at 12:11, DrMajorBob wrote:

> Clear[powerSum, test]
> powerSum[polynomial_, vars_List] /; PolynomialQ[polynomial, vars] :=
>   Module[{powers, coefficients, roots, soln},
>    powers = Exponent[polynomial, #] & /@ vars;
>    coefficients = Table[Unique[c], {Length@vars}];
>    roots = Table[Unique[r], {Length@vars}];
>    soln = SolveAlways[coefficients.(vars - roots)^powers ==
> polynomial,
>        vars][];
>    {roots, coefficients} = {roots, coefficients} /. soln;
>    coefficients.(vars - roots)^powers
>    ]

```

• References:
• Prev by Date: Re: Block[], OpenRead[], & /@
• Next by Date: Re: Adding a value to the cell of a matrix
• Previous by thread: Re: Re: question 1
• Next by thread: Re: Re: question 1