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$
  • $\begingroup$ SolveAlways[(56 - 85689 x)^2 - 3136 == -2 a b x + b^2 x^2, {x}] $\endgroup$ – matrix89 Apr 23 '18 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$ – Jack LaVigne Apr 23 '18 at 11:06
  • $\begingroup$ Do you actually want to solve for "$-2ab$" and "$b^2$"? $\endgroup$ – Eric Towers Apr 23 '18 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$ – Daniel Lichtblau Apr 23 '18 at 15:10
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, privacy policy and cookie policy

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