MathGroup Archive 2010

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

Search the Archive

Re: coefficients of polynomial

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107959] Re: [mg107939] coefficients of polynomial
  • From: "Carl K. Woll" <carlw at wolfram.com>
  • Date: Thu, 4 Mar 2010 05:25:49 -0500 (EST)
  • References: <201003031052.FAA20347@smc.vnet.net>

On 3/3/2010 5:52 AM, Jim Armstrong wrote:
> Hi,
>
> I am trying to find the coefficients d,e,f of this simple equating:
>
> ax^2+bxy+cy^2=d(x+y)^2+e(x-y)^2+f(x^2-y^2)
>
> I mean I am waiting for this type of solution:
>
> d=(a-b+c)/2
> e=b/2
> f=(a-c)/2
>
> so how can I get these constants?
>
> I searched it and tried to use Solve, Expand...but either they dont give it or they solve it in terms of all terms (a,b,c,x,y).
>
> Thanks a lot
>
>    

One possibility is SolveAlways:

In[5]:= SolveAlways[a x^2 + b x y + c y^2 == d (x + y)^2 + e (x - y)^2 + 
f (x^2 - y^2), {x, y}]

Out[5]= {{b -> 2 a - 4 e - 2 f, d -> a - e - f, c -> a - 2 f}}

This produces results for b, d, and c instead of d, e, f. You can then 
convert to your form by converting to equations and solving for d,e,f. 
Another alternative is to notice the following statement in the help:

SolveAlways[eqns,vars] is equivalent to Solve[!Eliminate[!eqns,vars]].

So, try:

In[6]:= Solve[!
   Eliminate[
    a x^2 + b x y + c y^2 !=
     d (x + y)^2 + e (x - y)^2 + f (x^2 - y^2), {x, y}], {d, e, f}]

Out[6]= {{d -> 1/4 (a + b + c), e -> 1/4 (a - b + c), f -> (a - c)/2}}

Carl Woll
Wolfram Research




  • Prev by Date: Alternatives to ARPACK?
  • Next by Date: Re: ListContourPlot3D - only working with arrays?
  • Previous by thread: Re: coefficients of polynomial
  • Next by thread: Re: Re: coefficients of polynomial