Symbolics > Working with Symbolics > To Find the Coefficients of a Polynomial
  
To Find the Coefficients of a Polynomial
Choose one or more of the methods below:
Place the cursor at the end of the polynomial, insert the symbolic evaluation operator, and type the keyword coeffs in the placeholder.
Click to copy this expression
Here, the first entry of the vector is 0 because the constant term of the polynomial is 0.
To return a second column containing the exponents corresponding to each coefficient, type the optional modifier degree after coeffs.
Click to copy this expression
If the polynomial contains more than one variable, type a comma after coeffs, followed by the variable with respect to which you want the coefficients expressed. PTC Mathcad returns a vector containing the coefficients of the polynomial. If all the exponents are positive, the first element of the vector corresponds to the constant term. If all exponents are negative, the last element corresponds to the constant term. Otherwise, PTC Mathcad returns the coefficients for the smallest exponent to the largest, in order, with zeros for any skipped exponents in the expression, and always including the constant term.
Click to copy this expression
For an expression containing several variables, PTC Mathcad writes the expression as a polynomial in the variable you specify after coeffs and in this case x. This is the same operation that the keyword collect performs.
Click to copy this expression
The coefficients that PTC Mathcad returns are expressions involving the variables other than the one you specify, so if you specify variable y, PTC Mathcad returns the following result:
Click to copy this expression