UnXFAIL an XPASSing pretty_sum test
Use binding = prettyForm.MUL in several classes' printers

This makes the classes be parenthesized when used in a Pow.  This is an
alternate fix to #1788.  I changed Integral, Sum, Product, and Derivative. In
general, any kind of operator should use this, since it is printed like the
operator *times* the operand.

Also remove the special casing in print_Pow from #1788, since it was incorrect
in light of the existence of the binding settings.

This is a better fix of issue 3260.
Fix the baseline for Piecewise printing

This fixes part of issue 3354.
Add new prettyForm binding, OPEN, which parenthesizes in Add

This is useful for things like Piecewise which need to be parenthesized even
in Add.

There is code in _print_Add that handles negatives that should probably be in
prettyForm.
Pretty print Piecewise always using parentheses

This changes the binding to OPEN, which causes it to parenthesize whenever it
is in an Add, Mul, or Pow.  This results in much easier to read expressions,
especially when a Piecewise is in an Add to the left of other terms.

This finishes the fixes of issue 3354.
Missing translations for tutorial.ru.po (issue 3526)
Implement next_lexicographic and prev_lexicographic:wq
Don't rely on bool(Relational) in the Piecewise solver.

Fixes issue 2961:
__nonzero__ method of Rel breaks solve of Piecewise functions
http://code.google.com/p/sympy/issues/detail?id=2961
Solution is valid iff Piecewise conditions are satisfied.
fixed whitespaces
Optimized number of permutations of mappings in heurisch()
Reduced the number of permutations of mapping by not generating cases where mapping[-1] != x
While earlier the number of terms or components of a function being permuted were (say) n after these changes they have reduced to n-1, thus improving the time complexity

Optimized number of permutations of mappings in heurisch()

Inorer to reduce the number of permuations of mapping we can remove the unnecessary_tuples that is one of the form (x, x_)
and can append these to the end of all permuted mappings
renamed store_tuple to unnecessary_permutations
Changed integrate_primitive_polynomial from recursive to iterative

Solved the cases such as risch_integrate(log(x)**1001,x)

Earlier

        risch_integrate((log(x)+1)**1001,x)
        RuntimeError: maximum recursion depth exceeded while calling a Python object

Now

        risch_integrate((log(x)+1)**1001,x)
        gives answer within few seconds without any recursion limit getting exceeded
Implemented risch_integrate for trigonometric, inverse trigonometric and hyperbolic functions

Earlier:

        risch_integrate(sin(x),x)
        NotImplementedError

Now:

        risch_integrate(sin(x),x)
        -cos(x)
        integrate(sin(x),x,risch=True)
        -cos(x)

Added flag "rewrite_complex" to prevent calculation of every integral in terms of complex numbers (as we can get better results from other algorithms).
Conversions of trigonometric , inverse trigno , hyperbolic is implemented a s a fall back measure(if no algorithm gives anti-derivative then all the above functions would be converted into exponential or logarithmic components)

changed self.f.rewrite -> self.newf.rewrite
Add a test with a Piecewise result.
Pyflakes cleanup to pretty printing
Merge pull request #1916 from asmeurer/piecewise_print

Fixes to printing
less flattening in Add and Mul

* sympy/core/add.py
    - in the 2-arg optimization
        o if an Add is encountered in the 2-arg optimaztion code
          let the main loop handle denesting of it; a test was added for this
        o don't expand the 2-arg mul

* sympy/core/mul.py

    - in the 2-arg optimization (as for Add), if an unevaluated Mul
      is encountered, let the main flattening loop handle it; a test was added

    - in the main flattening loop
        o restrict the 2-arg add distribution to purely commutative
	  expressions; now, at least, 2*(A+B) won't distribute any more
	o removed note about I being unevaluated if it has a Rational exponent;
	  what is actually happening is that I is always being treated as
	  (-1)**(1/2).

* sympy/core/strategies/tests/test_traverse.py

    - apparently the removed code from the 2-arg mul optimization allows
      this test to be modified without the need for rebuild (which I think
      is a good thing)

* sympy/core/tests/test_arit.py

    tests described above were added; test that no longer conforms to
    criteria was changed

* sympy/core/tests/test_expand.py

    a test is changed because of greater care in not distributing Number on
    non-commutative Add

* sympy/functions/elementary/tests/test_exponential.py

    test changed to equivalent forms

* sympy/integrals/tests/test_transforms.py

    wrapped a long test

* sympy/simplify/tests/test_simplify.py

    radsimp is apparently using an unevaluated Mul and that could be
    changed, but for now I just modified the test that failed because
    the unevaluated Mul is not longer denested. expand could also be used
    to denest it.
move perfect powers removal to _eval_expand_log
minor edits
multiplication leaves unevaluated Mul as Mul, not Add

This fixes issue 3798, too.