Recently, I was wondering about the following question:
Given a polynomial $P(x)$ with real coefficients, express its degree $d$ as a function of only $P(x)$, i.e. $d(P(x))$. Only elementary functions/operations and values of $P$ (or its derivatives/anti-derivatives) at any value may be used.
There must be several creative ways to do this. After some experimentation, I came up with the following:
$$d(P(x)) = \sum_{i=1}^{\infty} \text{sgn}\left(\sum_{j=0}^{\infty} \left| \frac{d^{i+j} P}{dx^{i+j}} (0) \right| \right)$$
Are there simpler functions that work? Any inputs are welcome.