# Solving for coefficients in a polynominal

I've the following problem:

how can I solve for the coefficients in a polynominal?

So, I mean the following:

I've the following expression:

$$\left(56-85689\cdot x\right)^2-3136\tag1$$

And I know that I can write:

$$\left(a-bx\right)^2-a^2=-2 a b x + b^2 x^2\tag2$$

Now:

How can I solve for $-2ab$ and $b^2$ using $(1)$? Without writing out the product using bij $(1) because in a real life example it is not a square but a 9th power or something. It does not work when I try: Solve[(56 - 85689)^2 - 3136 == -2 a b x + b^2 x^2, {a, b}]  • SolveAlways[(56 - 85689 x)^2 - 3136 == -2 a b x + b^2 x^2, {x}] Apr 23, 2018 at 9:24 • You left an “x” out of the product 85689 in the Solve. Might not help but the question should be edited. Sent from my iPad Apr 23, 2018 at 11:06 • Do you actually want to solve for "$-2ab$" and "$b^2\$"? Apr 23, 2018 at 14:15
• The example above appears to use two different values for a. Anyway, my guess is CoefficientList would be the desired function. Apr 23, 2018 at 15:10

## 1 Answer

Solve[ CoefficientList[(56 - 85689 x)^2 - 3136, x] == CoefficientList[-2 a b x + b^2 x^2, x], {a, b}]

{{a -> -56, b -> -85689}, {a -> 56, b -> 85689}}