Do we count only distinct roots in Descartes' rule of signs? Descartes' rule of signs states that numbet of positive roots of a polynomial $P(x) = a_nx^n + ... + a_1x + a_0$ is not greater than the number of sign changes of coefficients.
By Gauss we know that number of complex roots of $P(x)$ is $n$ and therefore, number of real (in this case positive) roots is certainly $\leq n$ and we can count same roots more than once if $P(x)$ indeed has multiple roots.
Okay, suppose that number of signs changes of $P(x)$ is $k$ and also suppose that we have set $S$ of all positive roots of $P(x), S = \{x_1, x_2, ..., x_m\}, m \leq n$ and some $x_i, x_j$ can be equal. Now, take that same set and eliminate those equal elements (eliminate all $x_i = x_j$ when $i \neq j$), that new set call $S'$ and let's say $|S'| = r.$
Does Descartes' rule of signs tells us that $m$ cannot be greater than $k$ or that $r$ cannot be greater than $k$?
Does this rule counts multiple roots more than once or it counts just disctint roots?
I am asking this because the geometric proof given here https://math.hmc.edu/funfacts/descartes-rule-of-signs/ has sense to me if we count only distinct roots (because that's number of intersections of polynomial with the $x$-axis) but no otherwise. Thanks
I saw in the comments that the rule counts multiple roots (say $x_0$) more than once. Since the proof given in the link is geometric, does polynomial bounces near the crossing point $(x_0, 0)$?
How exatcly the number of $x_0$'s we counted reflect on the behaviour of $P(x)$ near that point? ($)
My hypothesis is that if that number is even polynomial has parabolic shape near that point and if it is odd polynomial has shape simillar to the curve $x^3$ (and since the parity of sign changes and positive roots (counted with multiplicity) are equal, then this does not change number of ups and downs of our curve - now proof has sense but please answer #)
 A: If $X$ is a root with multiplicity $m$, then $f(x)= (x-X)^m$ divides $p(x)$, so $p(x)=f(x) q(x)$ for some polynomial $q(x)$ where $q(X)\ne0$. Note that because $q(X)$ is (continuous) polynomial with $P(X)\ne0$, there is some small interval $[X_-,X_+]$ not containing $0$ (where $X_-<X<X_+$) on which $q(x)\ne0$ and does not change sign.
If $m$ is even, $f(X_-)$ and $f(X_+)$ are both positive (they are both even powers of a nonzero number), and therefore $p(X_-)$ and $p(X_+)$ have the same sign as $q(X)$. If $m$ is odd, $f(X_-)>0$ and $f(X_+)<0$ so $p(X_-)$ and $p(X_+)$ have opposite signs, as they are odd powers of a negative number ($X_--X$) and a positive number ($X_+-X$), respectively.
Therefore when $X$ is a root of $p(x)$ with odd multiplicity, the graph of $p(x)$ crosses over the $x$-axis at $x=X$. When $X$ is a root of $p(x)$ with even multiplicity, the graph of $p(x)$ “bounces” on the $x$-axis at $x=X$.
A: It looks like two things are interchanged in OP.
$\color{blue}{\text{Descartes rule of signs}}$ is not about the sign of $P(x).$
It is about the $\color{blue}{\text{number of sign changes of coefficients}}$, which are ordered accordingly to the powers of $x.$
In the present exercise, the coefficients are $$\underbrace{1}_+,\underbrace{7}_+,\underbrace{-4}_-,\underbrace{-1}_-,\underbrace{-7}_-.$$ Sign change appears only once, it is between $7$ and $-4.$ Therefore, $P(x)$ has exactly one positive root.
As for eventual negative roots, we count the sign changes between coefficients of the polynomial $P(-x).$ The coefficients are $1,-7,-4,1,-7.$ This time, three changes appear. Therefore, our polynomial $P(x)$ has three roots with negative real part. They can be all real, or one real and a pair of complex conjugate roots.

As for your additional question:
Example
Consider $P(x)=x^2-2x+1.$ Here are two sign changes. Accordingly to Descartes rule of signs, the polynomial has two roots with positive real part. These roots can be both positive (equal or not), or it is a pair of complexe conjugate roots. Descartes rule says nothing more.
Since it is a quadratic polynomial, $P(x)$ has no other roots.
The same answer (by Descartes rule) would be given for the polynomials $x^2-2x+4$ or $x^2-2x+\frac{1}{2},$ in general, for $x^2-2x+c$ with $c>0.$
Therefore, the geometric interpretation that you try to associate to the polynomial, is not related to the Descartes rule of signs.
