Polynomial remainder sequences, gcd, and resultant

Documentation on the computation of gcd's and resultant's of
polynomials via remainder sequences, with emphasis on subresultants.
Computing resultant with subresultants

Reordered the loop in the computation of subresultants to include
one more scalar subresultant, namely, the resultant. Another loop
in the resultant function can then be omitted.

Notes:

1. The subresultants and the resultant of the pair `(f,g)` as computed
   are actually those of the pair `(g,f)` if `\deg(f) < \deg(g)`.
   This may have effect on the signs, but that is harmless in general
   when the resultant is only used for eliminating a variable.
   I have not changed this to save some time in the computation.
   Correct signs may be restored afterwards if that is necessary.

2. The resultant of `(f,0)` is zero indicating that `f` and `0` have
   common roots, namely every root of `f`. However, if `f` is a
   non-zero constant, it has no roots. In this case the resultant
   should be different from zero -- in fact one, by convention.
   I have not changed this as it would break the test in
   test_euclidtools.py.
integrals: An amendment to spde()

The iterative version of spde() currently assumes that the
coefficient  a  of  Dp  were invariant in the loop, in which
case the values of the multiplier  alpha  are powers of  a.
Otherwise the offset  beta  of the solution will be incorrect.

I have added two test cases where  a  is not invariant.
In the general case,  alpha  can be used instead of a power of  a
to construct the correct value of  beta.
product should return 1 if term=1, fixes #8301
doit() keeps unevaluated Product, if _eval_product returned nan
Fix the flickering problem
Add rational kwarg for Mul.as_coeff_mul, like for as_coeff_Mul
Merge pull request #8376 from certik/issue3971

Fix the flickering problem
Fix evaluation of reciprocal trigonometric functions in even quadrants

fixes #8421
Merge pull request #8422 from skirpichev/8421-fix

Fix evaluation of reciprocal trigonometric functions in even quadrants
Improve evaluation of relationals with -oo if "other" arg is positive

fixes #8449
Merge pull request #8460 from skirpichev/8449-fix

Improve evaluation of relationals with -oo if "other" arg is nonnegative
Relational.canonical simplifies Ge -> Le and Gt -> Lt

This is made part of Relational simplification.

The presence of Relationals in Booleans sent to equals
raises an error since that routine is not set up to handle
them.
And and Or are complementary-arg aware

In addition, trivially equivalent forms like x > 1 and 1 < x are
recognized.
Implies is complementary-arg aware
Xor is complementary-arg aware
Equivalent is complementary-arg aware
8413: Min and Max are floor and ceiling aware

- facilitate changes with reversed property of Relational which
  reverses the direction of the Relational
special-case +/-oo in _Inequality
put Number on rhs when simplifying Relational

This will allow any test to be written as 0 < x or x > 0 since the former
will turn into the latter by Python rules (unless S(0) < x is written).