2
$\begingroup$

I am writing a book and for the sake of simplicity I want to do something as follows.

Coef((-3x^2 +5x -1)(x^2 +1), 2) = -3 -1 = -4

where the first argument represents polynomial expression and the second one represents order of coefficient we want to output.

Is there a conventional function notation that takes a polynomial and order and yields the coefficient corresponding to the order? In other words, is there Coef-like notation defined by mathematicians?

$\endgroup$
5
  • 1
    $\begingroup$ I am not sure about a built-in function to do this, but you could write one up that first evaluates at $0$, then takes derivatives and re-evaluates at $0$, making sure the loop stopped based on the degree of the polynomial (surely there is a built-in function that returns degree of the polynomial, though that could be easily programmed too...). E.g., $f(x) = 4x^3 - 9x + 2$; then $f(0) = 2$; $f'(0) = -9$; $f''(0) = 2! \cdot 0$; and $f'''(0) = 3!\cdot 4$. Not sure if this answers your question - also not sure if your question is on topic for MESE... $\endgroup$ Jun 22, 2014 at 22:50
  • 3
    $\begingroup$ I have seen f[x^n] to mean the coefficient on the x^n term in the polynomial f. See, for instance, this link (which uses [x^n]f, but it's the same idea, and from the context I've always seen, generating functions): cut-the-knot.org/blue/GeneratingFunctions.shtml $\endgroup$ Jun 22, 2014 at 22:53
  • 1
    $\begingroup$ I think this is basically on topic for MESE, especially if he is using this notation in a book designed to teach students about polynomials. $\endgroup$ Jun 23, 2014 at 1:29
  • 1
    $\begingroup$ @StevenGubkin Could be; in any event, it seems a satisfactory answer was provided! Just to be more precise about my own comment above: Let $f^{n}(x)$ denote the $n$th derivative of $f(x)$ where $f^{0}(x) := f(x)$; then $\displaystyle \frac{f^{n}(0)}{n!}$ returns the coefficient of $x^n$. $\endgroup$ Jun 23, 2014 at 1:36
  • $\begingroup$ I imagined that the asker is writing a beginning algebra text. Would be useful to have more context. $\endgroup$ Jun 23, 2014 at 2:38

1 Answer 1

6
$\begingroup$

A notation common when dealing with generating functions (where this operation is crucial) is to write $$ [z^n] A(z) = a_n $$ When $A(z) = \sum_{k \ge 0} a_k z^k$.

But also see e.g. Knuth "Bracket notation for the 'coefficient of' operator" in A classical mind: Essays in honour of C. A. R. Hoare, pages 247-258 (Prentice Hall 1994), also arXiv.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.