Back to Symbolic Math (SymEngine)
sym.coeff
Extract the coefficient of x^n from an expression.
Syntax
sym.coeff(expr, x, n)
Description
Extract the coefficient of x^n from an expression. For a polynomial expression, returns the coefficient of the term x^n. If n is 0, returns the constant term.
Parameters
| Name | Description |
|---|---|
| expr | - The expression to extract the coefficient from. |
| x | - The variable to extract the coefficient of. |
| n | - The power of x (as an expression, typically an Integer). |
Returns
Expr