Andrew Mir
Andrew Mir

Reputation: 125

A prohibition on the disable of brackets in sympy

There is the following simple problem:

integrate((x-2)^3,x)

Instead of just giving a simple answer:

(x-2)^4/4

Sympy spreads out on an endless tape

x^4/4-2*x^3+6*x^2-8*x

It can be trained to give an easy answer, as (x-2)^4/4?

Upvotes: 1

Views: 41

Answers (1)

Oscar Benjamin
Oscar Benjamin

Reputation: 14500

You can use the "manual" integration method:

In [24]: integrate((x-2)**3,x, manual=True)
Out[24]: 
       4
(x - 2) 
────────
   4    

Upvotes: 2

Related Questions