Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep fractions in your equation output

Tags:

I've been using Python to calculate math equations. For example:

from sympy import Symbol, Derivative, Integral
x = Symbol('x')
d = Symbol('d')
Integral(8*x**(6/5)-7*x**(3/2),x).doit()

Which results in the output:

3.63636363636364*x**2.2 - 2.8*x**2.5

Is there a way to show this answer as fractions as opposed to decimals? I would like to see the output as:

(40/11)*x**(11/5)-(14/5)*x**(5/2)+C