[Date Index]
[Thread Index]
[Author Index]
Coefficient[ ] quirks
*To*: mathgroup at smc.vnet.net
*Subject*: [mg93310] Coefficient[ ] quirks
*From*: AES <siegman at stanford.edu>
*Date*: Mon, 3 Nov 2008 05:28:38 -0500 (EST)
*Organization*: Stanford University
If you have a function f = a + b (z-c)^2 and want to extract out the
powers of the "form" (z-c), you can use either Coefficient[f, (z-c), n]
or Coefficient[f, (z-c)^2, n]. The first one gives you {a, 0, b} for
the first three coefficients, while the second one gives you {a, b, 0},
both of these of course being entirely correct.
Suppose however that you add a denominator to the function, e.g.
f = (a + b (z-c)^2 )/d. Then the first approach (looking for powers of
(z-c)) no longer gives you the information you're seeking, but instead
stuffs the entire f into the first position, i.e. {f, 0, 0} -- which at
least doesn't throw away any information about f.
The second approach (looking for powers of (z-c)^2) still works fine
even with a denominator added, however, and gives you {a/d, b/d, 0}.
If out of restless curiosity, you then expand out the square of (z-c)
into either of the forms f = (a + b (z^2 - 2 c z + c^2) or
f = (a + b z^2 - 2 b c z + + b c^2), with or without the denominator,
but still seek powers of (z-c) (which are no longer explicitly present),
the first approach continues to give you {f, 0, 0}, which it can be
argued is entirely correct, since there is no longer any explicit power
of (z-c) in f.
The second approach, however, now gives you either {a, 0, 0} or {a/d, 0,
0}, which in a certain sense is arguably correct for the first or n=0
term -- any powers of z or c have apparently been chopped off, even
though you asked Coefficient to look only for powers of (z-c).
The only problem is that they seem to have been thrown out totally,
beyond recovery. You could write
f = Sum[Coefficient[f, (z-c), n] * (z-c)^n, {n,0,Infinity}]
for f with or without denominator, and never get all your function back.
It all seems rather quirky . . .
Prev by Date:
**Re: Re: ODE solution problem**
Next by Date:
**Re: Eliminating common factors?**
Previous by thread:
**Re: Re: Re: ODE solution problem**
Next by thread:
**Re: Coefficient[ ] quirks**
| |