Thursday, November 20, 2025
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
32404 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6776 POSTS0 COMMENTS
Nicole Veronica
11924 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11994 POSTS0 COMMENTS
Shaida Kate Naidoo
6904 POSTS0 COMMENTS
Ted Musemwa
7159 POSTS0 COMMENTS
Thapelo Manthata
6859 POSTS0 COMMENTS
Umr Jansen
6846 POSTS0 COMMENTS