MathGroup Archive 2010

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

Search the Archive

Re: Re: Re: coefficients of

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108037] Re: [mg108013] Re: [mg107975] Re: [mg107939] coefficients of
  • From: "Christoph Lhotka" <christoph.lhotka at univie.ac.at>
  • Date: Sun, 7 Mar 2010 04:02:21 -0500 (EST)
  • References: <201003031052.FAA20347@smc.vnet.net>

yes, I should have done it without local variable definitions (as usual,
;o)):

Solve[Thread[(MonomialList[#[[1]]-#[[2]],{x,y}]/.x|y->1)==0],{d,e,f}]&[a*
x^2+b*x*y+c*y^2==d*(x+y)^2+e(x-y)^2+f(x^2-y^2)]

sorry for publishing the wrong code and thanks for the correction,

Christoph


On Fr, 5.03.2010, 10:33, DrMajorBob wrote:
> That doesn't work:
>
> Block[{equ =
>     a x^2 + b x y + c y^2 == d (x + y)^2 + e (x - y)^2 + f (x^2 - y^2),
>     con = MonomialList[equ[[1]] - equ[[2]], {x, y}] /. x | y -> 1},
>   Solve[Thread[con == 0], {d, e, f}]]
>
> {{d -> -((e (x - y)^2)/(x + y)^2) - (f (x - y))/(
>      x + y) - (-a x^2 - b x y - c y^2)/(x + y)^2}}
>
> But this does:
>
> Block[{equ =
>     a x^2 + b x y + c y^2 == d (x + y)^2 + e (x - y)^2 + f (x^2 - y^2),
>     con},
>   con = MonomialList[equ[[1]] - equ[[2]], {x, y}] /. x | y -> 1;
>   Solve[Thread[con == 0], {d, e, f}]]
>
> {{d -> 1/4 (a + b + c), e -> 1/4 (a - b + c), f -> (a - c)/2}}
>
> Bobby
>
> On Thu, 04 Mar 2010 04:28:46 -0600, Christoph Lhotka <lhochr at gmail.com>
> wrote:
>
>> hi, try out
>>
>> Block[
>>  {equ = a x^2 + b x y + c y^2 == d (x + y)^2 + e (x - y)^2 + f (x^2 -
>> y^2),
>>    con = MonomialList[equ[[1]] - equ[[2]], {x, y}] /. x | y -> 1},
>>  Solve[Thread[con == 0], {d, e, f}]
>>  ]
>>
>> Christoph
>>
>>
>> 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
>>>
>>>
>>>
>>>
>>
>>
>
>
> --
> DrMajorBob at yahoo.com
>
>
>


-- 
Mag. Christoph Lhotka
University of Vienna / Institute for Astronomy
Tuerkenschanzstrasse 17, A-1180 Vienna, Austria
fon. +43 (1) 4277 51841
mail. lhotka at astro.univie.ac.at



  • Prev by Date: Re: removing non-numeric elements from the table
  • Next by Date: Re: learning calculus through mathematica
  • Previous by thread: Re: Re: coefficients of polynomial
  • Next by thread: Re: coefficients of polynomial