2
$\begingroup$

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}]
$\endgroup$
4
  • $\begingroup$ SolveAlways[(56 - 85689 x)^2 - 3136 == -2 a b x + b^2 x^2, {x}] $\endgroup$
    – matrix42
    Commented Apr 23, 2018 at 9:24
  • $\begingroup$ 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 $\endgroup$ Commented Apr 23, 2018 at 11:06
  • $\begingroup$ Do you actually want to solve for "$-2ab$" and "$b^2$"? $\endgroup$ Commented Apr 23, 2018 at 14:15
  • $\begingroup$ The example above appears to use two different values for a. Anyway, my guess is CoefficientList would be the desired function. $\endgroup$ Commented Apr 23, 2018 at 15:10

1 Answer 1

7
$\begingroup$

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}}

$\endgroup$

Your Answer

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

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