Is there a function that returns the degree of a polynomial?

I'm playing around with some equations in Geogebra and the degree of the polynomials I am using has become a variable. Is there an exact method for determining the degree of a polynomial?

I am currently approximating the degree of $f(x)$ by using:

$$\text{Degree}(f(x)) = \lfloor\log_{1000}(f(1000))\rfloor$$

This has been a decent enough approximation, but it got me wondering whether or not there exists a precise method? One that could be applied to non-integer degree polynomials.


Solution 1:

In general, if $f(x)$ is a polynomial of degree $n$, then $$\lim_{x\to\infty} \frac{\log(|f(x)|)}{\log(x)} = n$$

This works because, for large values of $x$, we would have $|f(x)| \approx |a_n| x^n$, where $a_n$ is the leading coefficient, and therefore $\log(|f(x)|) \approx \log(|a_n|) + n\log(x)$. Divide this by $\log(x)$, and we get $\frac{\log(|f(x)|)}{\log(x)} \approx \frac{\log(|a_n|)}{\log(x)} + n$. In the limit as $x \to \infty$, the first term goes to $0$.

Moreover, even if $f(x)$ is not a polynomial, but (say for example) something like $f(x) = x^{1/2} - 3x^{1/3}$, this method works, in that it returns the largest non-negative exponent among the terms; in this case, we get $1/2$.

Solution 2:

According to the GeoGebra wiki, the function you're looking for is Degree[<Polynomial]. If you have a polynomial in several variables, you can also use Degree[<Polynomial>,<Variable>] to get the degree of the polynomial in the specified variable.