How can I check if a function is always $\ge 0$ for all values of its parameter $\ge 0$? Let's say I have a function with with arbitrary coefficients and powers, something like $f(x) = 5x^2 - 7x^3 + x^4$. 
How can I check if this function is always $\ge 0\ \forall x \ge 0$? The procedure is something I'm going to encode in Python.
 A: Finding the roots, especially with polynomials but more widely with continuous functions, will allow you to have only a few cases to check (basically $n + 1$, $n$ being the number of roots). For this you can use Newton's method for instance.
For instance here you can factor your polynomial with $x^2$ ($0$ is a 'double' root), and you have $2$ other roots which let you determine whether or not this polynomial is positive with only 3 'if's.
This can even be more shortened because you only need positive roots, and for a polynomial you can have the sign in $0^+$ and $+\infty$ even more easily (as it is the sign of respectively the lowest and highest degree coefficient).
A: You can try and arbitrary point to see if the function is ever positive. If it is, then try and solve $f(x) = 0$ to see if your function ever crosses the x axis (which means it could go negative in that vicinity). Algorithms which solve such equations are called 'root finding' techniques. I think for an arbitrary polynomial the task is pretty difficult.
A: By hand you would state the inequality $f(x) \ge 0$ and would try to solve for $x$. For arbitrary polynomials $P(x)$ this is not possible.
So you would need to rely on numerical methods.
You start with $P(0)$ and if that one is positive it will stay positive until it hits a root, thus an argument value $x_1$ with $P(x_1) = 0$. From $x_1$ on you need to check, if $P$ continues with negative values.
For polynomials the fundamental theorem of algebra tells one that a (non constant) polynomial of highest power $n$ has $n$ complex roots (a root might show up several times, like $x=0$ in your example twice), and thus $n$ or less real roots. You could try to determine these roots one by one. 
So the procedure is finite.
