4
$\begingroup$

I have a polynomial F[x], for example F[x] = 1 - 2x + x^2. I wanna check whether F[x] has the form of (1 + kx)^n. For the example above, k = -1 and n = 2.

I have searched on several documents but found nowhere has the answer. So can I do this on Mathematica? If yes, how can I get k and n?

$\endgroup$
5
  • 1
    $\begingroup$ $n$ is going to be the order of the polynomial f[x]. Then $k^n$ is the coefficient of $x^n$, so $k=coef^{(1/n)}$. Then test to see if f[x] is the same as (1+k x)^n. $\endgroup$
    – bill s
    Sep 3, 2013 at 3:28
  • $\begingroup$ @Kuba Oh I thought they are the same, aren't they? I mean it can be represented in that form. $\endgroup$
    – Loi.Luu
    Sep 3, 2013 at 6:07
  • $\begingroup$ Just done @Kuba :) $\endgroup$
    – Loi.Luu
    Sep 3, 2013 at 6:12
  • $\begingroup$ @bills what I wanna do is that I send the polynomial to Mathematica, simplify it and then check the question above automatically. If Mathematica is not capable of doing that then I will have to put more manual work like your suggestion. Thank you anw. $\endgroup$
    – Loi.Luu
    Sep 3, 2013 at 6:16
  • $\begingroup$ Have you tried Factor or Simplify on F[x]? $\endgroup$
    – asterix314
    Oct 14, 2013 at 3:03

1 Answer 1

3
$\begingroup$

It may be naive but I think the following should work:

If the polynomial has this form this means it has one multiple root which is not 0:

check[f_?PolynomialQ] := Length@DeleteDuplicates@Solve[f[x] == 0, x] == 1 && f[0] != 0

check[f]
True

Notice that I'm not bothering about n and k. Do you want to find them?


It works even for not so exact coefficients:

f[x_] := (1/5 - 1/3 x)^5 // Expand // N
f[x]
0.00032 - 0.00266667 x + 0.00888889 x^2 - 0.0148148 x^3 + 0.0123457 x^4 - 0.00411523 x^5
check[f]
True
f[x_] := (1/5 + 1/3 x)^5 + 2 // Expand // N
check[f]
False
$\endgroup$
4
  • $\begingroup$ It's a good idea. Since Mathematica will return all the roots hence we can check whether they are duplicated roots. Then we can find N consequently. I think K is then easily found since 1/k is the only root of the F[X] == 0 right? $\endgroup$
    – Loi.Luu
    Sep 3, 2013 at 6:24
  • 1
    $\begingroup$ @Loi.Luu I just have to add that root equal to 0 should be excluded as it does not fit your form. $\endgroup$
    – Kuba
    Sep 3, 2013 at 6:25
  • $\begingroup$ Yeah, that's right. $\endgroup$
    – Loi.Luu
    Sep 3, 2013 at 6:27
  • $\begingroup$ @Loi.Luu ok it should work now :) $\endgroup$
    – Kuba
    Sep 3, 2013 at 6:29

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.