Wednesday, May 6, 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
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6891 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12105 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6962 POSTS0 COMMENTS