Friday, January 16, 2026
HomeLanguagessympy.integrals.rationaltools.ratint_ratpart() in python

sympy.integrals.rationaltools.ratint_ratpart() in python

With the help of ratint_ratpart() method, we can implement the Horowitz Ostrogradsky algorithm and it will return the fractions A and B by using this method.

Syntax : ratint_ratpart(f, g, x)

Return : Return the fraction A and B.

Example #1 :

In this example we can see that by using ratint_ratpart() method, we are able to compute the rational integration using Horowitz Ostrogradsky algorithm and return the fractions A and B.

Python3




# import ratint_ratpart
from sympy.integrals.rationaltools import ratint_ratpart
from sympy.abc import x, y
from sympy import Poly
  
# Using ratint_ratpart() method
gfg = ratint_ratpart(Poly(5, x, domain='ZZ'), Poly(x**4 + 1, x, domain='ZZ'), x)
  
print(gfg)


Output :

(0, 5/(x**4 + 1))

Example #2 :

Python3




# import ratint_ratpart
from sympy.integrals.rationaltools import ratint_ratpart
from sympy.abc import x, y
from sympy import Poly
  
# Using ratint_ratpart() method
gfg = ratint_ratpart(Poly(13, x, domain='ZZ'), Poly(4*x**2 + x - 2, x, domain='ZZ'), x)
  
print(gfg)


Output :

(0, 13/(4*x**2 + x – 2))

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

Most Popular

Dominic
32470 POSTS0 COMMENTS
Milvus
117 POSTS0 COMMENTS
Nango Kala
6838 POSTS0 COMMENTS
Nicole Veronica
11972 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12055 POSTS0 COMMENTS
Shaida Kate Naidoo
6975 POSTS0 COMMENTS
Ted Musemwa
7214 POSTS0 COMMENTS
Thapelo Manthata
6928 POSTS0 COMMENTS
Umr Jansen
6906 POSTS0 COMMENTS