# 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.

• Ah I see, in most contexts this is called the degree. – helloworld112358 May 16 '17 at 3:47
• Now that you've mentioned it that does ring a bell. Rapidly changes all notation – Ben Crossley May 16 '17 at 3:49
• Are you asking whether there is a function in Geogebra or in general? – martin.koeberl May 16 '17 at 3:56
• There's something of an imprecision here. Sure, there's a function like this: $a_nx^n + a_{n-1}x^{n-1} + \ldots + a_0 \mapsto n$, when we have access to the usual representation of our polynomial as a linear combination of powers of $x$. But really, you're interested in knowing if there's a way to find the degree of a polynomial when you only have access to the polynomial function's values, which is a seemingly more subtle problem. – pjs36 May 16 '17 at 4:01
• Use @username to ping certain people. If you start typing a username, it should suggest you the options where you can select using arrow keys and use tab completion (You're automatically pinged because it's your question). – martin.koeberl May 16 '17 at 4:19

## 2 Answers

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.

• I feel like I should have stumbled upon that. I guess that's what happens when you use the term order instead of degree! – Ben Crossley May 16 '17 at 4:17
• Well, for next time you know :) – martin.koeberl May 16 '17 at 4:19

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$.

• This is how I arrived at my approximation. Since I can't use limits in geogebra I think I'm just going to have to work with my approximation. If you know of any alternatives please let me know! – Ben Crossley May 16 '17 at 4:15
• @BenCrossley-hobbyist, why can you not use limits in GeoGebra? LimitBelow[log(abs(f(x)))/log(x), ∞] seems to work just fine. – N3buchadnezzar May 16 '17 at 9:53
• Because I was unaware that putting $\infty$ was valid! I've learned some great stuff in this question! – Ben Crossley May 16 '17 at 11:00
• This is essentially taking the logarithm base $x$. – Simon Kuang May 17 '17 at 21:36