Tuesday, June 9, 2026
HomeLanguagessympy.integrals.rationaltools.ratint() in python

sympy.integrals.rationaltools.ratint() in python

With the help of ratint() method, we can compute the indefinite integration of a rational function. If a function is a rational function, their is a Lazard Rioboo Trager and the Horowitz Ostrogradsky algorithms that are implemented in this method.

Syntax : ratint(f, x, **flags)

Return : Return the integrated function.

Example #1 :

In this example we can see that by using ratint() method, we are able to compute the indefinite integration of a rational function and return the integrated function by using this method.

Python3




# import ratint
from sympy.integrals.rationaltools import ratint
from sympy.abc import x
  
# Using ratint() method
gfg = ratint((x**5 - 2*x**3 + x - 2)/12, x)
  
print(gfg)


Output :

x**6/72 – x**4/24 + x**2/24 – x/6

Example #2 :

Python3




# import ratint
from sympy.integrals.rationaltools import ratint
from sympy.abc import y
  
# Using ratint() method
gfg = ratint((3*y**3 + 4*x**2 + y - 2), y)
  
print(gfg)


Output :

3*y**4/4 + y**2/2 + y*(4*x**2 – 2)

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32515 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6896 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7018 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6963 POSTS0 COMMENTS