Skip to main content
added 474 characters in body
Source Link
Robert Israel
  • 54.2k
  • 1
  • 76
  • 152

In Maple, you might try the probabilistic equivalence-tester testeq. For example:

testeq(407-768cos(1/5Pi)-716cos(1/7Pi)-364cos(11/35Pi)-170cos(1/35Pi)+170cos(6/35Pi)+364cos(4/35Pi)-594cos(9/35Pi)+594cos(16/35Pi)+692cos(2/5Pi)+670cos(2/35Pi)+670cos(12/35Pi)-440cos(3/35Pi)-440cos(17/35Pi)+246cos(8/35Pi)-246cos(13/35Pi)-292cos(3/7Pi)+486cos(2/7Pi)=0);

true

EDIT: For trigonometric polynomials in rational multiples of $\pi$ with rational coefficients, equality can be checked algebraically. Let $x = \sum_{n=1}^n a_j \cos(b_j \pi/m)$ where $m$, $a_j$ and $b_j$ are integers, $0 \le b_j < 2m$. Then if $\omega=e^{i\pi/m}$ we have $x=\sum_{j=1}^n a_j(\omega^{b_j}+\omega^{−b_j})/2$. So $x=0$ iff the minimal polynomial of $\omega$, which is the cyclotomic polynomial $\Phi_m(z)$, divides $\sum_{j=1}^n a_j (z^{2m+b_j} + z^{2m-b_j})$.

In Maple, you might try the probabilistic equivalence-tester testeq. For example:

testeq(407-768cos(1/5Pi)-716cos(1/7Pi)-364cos(11/35Pi)-170cos(1/35Pi)+170cos(6/35Pi)+364cos(4/35Pi)-594cos(9/35Pi)+594cos(16/35Pi)+692cos(2/5Pi)+670cos(2/35Pi)+670cos(12/35Pi)-440cos(3/35Pi)-440cos(17/35Pi)+246cos(8/35Pi)-246cos(13/35Pi)-292cos(3/7Pi)+486cos(2/7Pi)=0);

true

In Maple, you might try the probabilistic equivalence-tester testeq. For example:

testeq(407-768cos(1/5Pi)-716cos(1/7Pi)-364cos(11/35Pi)-170cos(1/35Pi)+170cos(6/35Pi)+364cos(4/35Pi)-594cos(9/35Pi)+594cos(16/35Pi)+692cos(2/5Pi)+670cos(2/35Pi)+670cos(12/35Pi)-440cos(3/35Pi)-440cos(17/35Pi)+246cos(8/35Pi)-246cos(13/35Pi)-292cos(3/7Pi)+486cos(2/7Pi)=0);

true

EDIT: For trigonometric polynomials in rational multiples of $\pi$ with rational coefficients, equality can be checked algebraically. Let $x = \sum_{n=1}^n a_j \cos(b_j \pi/m)$ where $m$, $a_j$ and $b_j$ are integers, $0 \le b_j < 2m$. Then if $\omega=e^{i\pi/m}$ we have $x=\sum_{j=1}^n a_j(\omega^{b_j}+\omega^{−b_j})/2$. So $x=0$ iff the minimal polynomial of $\omega$, which is the cyclotomic polynomial $\Phi_m(z)$, divides $\sum_{j=1}^n a_j (z^{2m+b_j} + z^{2m-b_j})$.

added 333 characters in body
Source Link
Robert Israel
  • 54.2k
  • 1
  • 76
  • 152

In Maple, you might try the probabilistic equivalence-tester testeq. For example:

testeq(407-768cos(1/5Pi)-716cos(1/7Pi)-364cos(11/35Pi)-170cos(1/35Pi)+170cos(6/35Pi)+364cos(4/35Pi)-594cos(9/35Pi)+594cos(16/35Pi)+692cos(2/5Pi)+670cos(2/35Pi)+670cos(12/35Pi)-440cos(3/35Pi)-440cos(17/35Pi)+246cos(8/35Pi)-246cos(13/35Pi)-292cos(3/7Pi)+486cos(2/7Pi)=0);

true

In Maple, you might try the probabilistic equivalence-tester testeq.

In Maple, you might try the probabilistic equivalence-tester testeq. For example:

testeq(407-768cos(1/5Pi)-716cos(1/7Pi)-364cos(11/35Pi)-170cos(1/35Pi)+170cos(6/35Pi)+364cos(4/35Pi)-594cos(9/35Pi)+594cos(16/35Pi)+692cos(2/5Pi)+670cos(2/35Pi)+670cos(12/35Pi)-440cos(3/35Pi)-440cos(17/35Pi)+246cos(8/35Pi)-246cos(13/35Pi)-292cos(3/7Pi)+486cos(2/7Pi)=0);

true

Source Link
Robert Israel
  • 54.2k
  • 1
  • 76
  • 152

In Maple, you might try the probabilistic equivalence-tester testeq.