Compute the roots of a Chebyshev series using NumPy in Python Last Updated : 25 Jul, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report This article will discuss how to compute the roots of a Chebyshev series in NumPy using Python. Chebyshev polynomials are important in approximation theory these are never formally generated. Only the coefficients are required for all calculations. If we want to compute the roots of a polynomial we have to use the chebyshev.chebroots() method in NumPy module available in python which returns an array that contains the series of roots. Out is real if all the roots are real; otherwise, it is complex. The c parameter is a one-dimensional array of coefficients. Syntax: chebyshev.chebroots((integers)) integers are the sequence of numbers separated by a comma. Return: It will return an array of the roots of the given series of integers. If all the roots are real, then output is also real, otherwise the output is complex. Example 1 In this example. we will import the Chebyshev module to create regular series with 5 integers and get the roots, data type, and shape. Python3 # import chebyshev from numpy.polynomials # module from numpy.polynomial import chebyshev # get the roots for normal numbers print(chebyshev.chebroots((-1, 0, 1, 2, 3))) # get the data type print(chebyshev.chebroots((-1, 0, 1, 2, 3)).dtype) # get the shape print(chebyshev.chebroots((-1, 0, 1, 2, 3)).shape) Output: [-0.96766052 -0.39810338 0.11832406 0.9141065 ] float64 (4,)Example 2 In this example. we will import the Chebyshev module to create complex series with 2 data and get the roots, data type, and shape. Python3 # import chebyshev from numpy.polynomials # module from numpy.polynomial import chebyshev # import complex math module import cmath # get the roots for complex numbers print(chebyshev.chebroots((complex(1, 2), complex(2, 3)))) # get the shape print(chebyshev.chebroots((complex(1, 2), complex(2, 3))).shape) # get the data type print(chebyshev.chebroots((complex(1, 2), complex(2, 3))).dtype) Output: [-0.61538462-0.07692308j] (1,) complex128 Comment More infoAdvertise with us Next Article Compute the roots of a Chebyshev series using NumPy in Python S sravankumar_171fa07058 Follow Improve Article Tags : Python Python-numpy Python numpy-polynomials Practice Tags : python Similar Reads Raise Chebyshev series to a power using NumPy in Python In this article, we will cover how to raise a Chebyshev series to power in Python using NumPy. polynomial.chebyshev.chebpow method The Chebyshev polynomials are like the other classical orthogonal polynomials which can be defined from a variety of starting locations.  Here, we will see how to raise 3 min read Compute the roots of a Legendre series in Python-NumPy In this article, we will discuss how to compute the roots of a Legendre series in python. legendre.legroots method In python, the Legendre module provides many functions like legdre to perform arithmetic, and calculus operations on the Legendre series. It is one of the functions provided by the Lege 2 min read Generate Chebyshev series with given complex roots using NumPy in Python In this article, we will cover how to generate the Chebyshev series with given complex roots in Python using NumPy. Example Input: (4+5j) Output: [9.5-40.j 0. +0.j 0.5 +0.j] Explanation: An array of Chebyshev series.chebyshev.chebfromroots() method In python, the Chebyshev module provides many funct 2 min read Differentiate a Chebyshev series using NumPy in Python In this article, we will cover how to integrate a Chebyshev series and set the integration constant in Python using NumPy. chebyshev.chebder method The Chebyshev series has polynomials with the largest possible leading coefficient, whose absolute value on the interval [â1, 1] is bounded by 1. They a 3 min read Compute the Roots of a Hermite_e series with given Complex Roots using NumPy in Python In this article, we are going to see how to compute the roots of a Hermite_e series with given complex roots in Python. NumPy hermeroots() Methods We use the hermite e.hermeroots() function in Python Numpy to get the roots of a Hermite e series. This function will return an array containing the seri 2 min read Like