Thursday, January 22, 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
32475 POSTS0 COMMENTS
Milvus
119 POSTS0 COMMENTS
Nango Kala
6847 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12064 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7220 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6912 POSTS0 COMMENTS