How to divide a polynomial to another using NumPy in Python? Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we will make a NumPy program to divide one polynomial to another. Two polynomials are given as input and the result is the quotient and remainder of the division. The polynomial p(x) = C3 x2 + C2 x + C1 is represented in NumPy as : ( C1, C2, C3 ) { the coefficients (constants)}.Let take two polynomials p(x) and g(x) then divide these to get quotient q(x) = p(x) // g(x) and remainder r(x) = p(x) % g(x) as a result.If p(x) = A3 x2 + A2 x + A1 and g(x) = B3 x2 + B2 x + B1 then result is q(x) = p(x) // g(x) and r(x) = p(x) % g(x) and the output is coefficients of remainder and the coefficients of quotient. This can be calculated using the polydiv() method. This method evaluates the division of two polynomials and returns the quotient and remainder of the polynomial division. Syntax: numpy.polydiv(p1, p2) Below is the implementation with some examples : Example 1 : Python3 # importing package import numpy # define the polynomials # p(x) = 5(x**2) + (-2)x +5 px = (5, -2, 5) # g(x) = x +2 gx = (2, 1, 0) # divide the polynomials qx, rx = numpy.polynomial.polynomial.polydiv(px, gx) # print the result #quotient print(qx) # remainder print(rx) Output : [-12. 5.] [ 29.] Example 2 : Python3 # importing package import numpy # define the polynomials # p(x) = (x**2) + 3x + 2 px = (1,3,2) # g(x) = x + 1 gx = (1,1,0) # divide the polynomials qx,rx = numpy.polynomial.polynomial.polydiv(px,gx) # print the result # quotient print(qx) # remainder print(rx) Output : [ 1. 2.] [ 0.] Comment More infoAdvertise with us Next Article How to add one polynomial to another using NumPy in Python? D deepanshu_rustagi Follow Improve Article Tags : Python Python-numpy Python numpy-Mathematical Function Practice Tags : python Similar Reads How to add one polynomial to another using NumPy in Python? In this article, Let's see how to add one polynomial to another. Two polynomials are given as input and the result is the addition of two polynomials. The polynomial p(x) = C3 x2 + C2 x + C1  is represented in NumPy as : ( C1, C2, C3 ) { the coefficients (constants)}. Let take two polynomials p(x) a 2 min read How to multiply a polynomial to another using NumPy in Python? In this article, we will make a NumPy program to multiply one polynomial to another. Two polynomials are given as input and the result is the multiplication of two polynomials. The polynomial p(x) = C3 x2 + C2 x + C1  is represented in NumPy as : ( C1, C2, C3 ) { the coefficients (constants)}.Let ta 2 min read How to subtract one polynomial to another using NumPy in Python? In this article, let's discuss how to subtract one polynomial to another. Two polynomials are given as input and the result is the subtraction of two polynomials. The polynomial p(x) = C3 x2 + C2 x + C1  is represented in NumPy as : ( C1, C2, C3 ) { the coefficients (constants)}.Let take two polynom 2 min read Convert a polynomial to Hermite_e series using NumPy in Python In this article, we will cover how to convert a polynomial to Hermite_e series using NumPy in Python. hermite_e.poly2herme method We use the hermite_e.poly2herme() function present in the NumPy module of python to convert a polynomial to a Hermite series. Here we need to convert an array of polynomi 2 min read Divide one Hermite series by another in Python using NumPy In this article, we are going to see how to divide one Hermite series by another in Python using NumPy. The numpy hermdiv() method helps us divide one Hermite series by another. The quotient and remainder of two Hermite series, c1 / c2, are returned. The arguments are a series of coefficients from l 3 min read Differentiate a polynomial and set the derivatives in Python-NumPy In this article, we will cover how to differentiate a polynomial and set the derivatives in Python. numpy.polynomial.polynomial.polyder method The Numpy library provides the numpy.polynomial.polynomial.polyder() method to differentiate a polynomial and set the derivatives. The polynomial coefficient 3 min read Like