The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.math.symbolic

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: An integral: Which one is wrong, Mathematica or sympy?
Replies: 4   Last Post: Apr 20, 2013 11:34 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 14
Registered: 10/22/07
An integral: Which one is wrong, Mathematica or sympy?
Posted: Apr 19, 2013 8:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello all,

Just for fun a plug the following mathematica integral

In[1]:= g = 1/(x*(1-a*(1-x)))

In[2]:= res=Integrate[g,x]

In[3]:= TeXForm[res]

Out[3]//TeXForm= \frac{\log (a (x-1)+1)-\log (x)}{a-1}

into sympy ( which can be tried online at [
] )
to obtain

In [1]: a = Symbol('a')

In [2]: g = 1/(x*(1-a*(1-x)))

In [3]: u=simplify(integrate(g,x))

In [5]: latex(u)
\frac{- \log{\left (2 x \right )} + \log{\left (\frac{- a^{2} + 2 a x
- 1\right) - a \left(a - 1\right) + 3 a - 2}{a \left(a - 1\right)}
\right )}}{
a - 1}

Surprisingly, sympy seems to give the right result without any
assumption, while mathematica's result seems to assume a>1, which is
not specified. Also for this case (a>1) sympy gives an extra constant
which is not present in the mathematica result.

Is there a way to (1) make mathematica to output a general result like
and (2) decide which one is really the correct result?


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.