I will explain my problem by illustrating a simple case.
Easy question: Let $f(x,y)$ be a "generic" polynomial in two variables, of total degree $\le D$. What's a good upper bound for how many critical points (minimum/maximum) it has in $\mathbb R^2$?
Solution: The critical points satisfy $\nabla f = 0$, so we can try to count the combined zeroes of the two polynomials $\frac {\partial f}{\partial x}$ and $\frac {\partial f}{\partial y}$, both of degree $\le D$. We assume they're both irreducible ($f$ is "generic"), and Bezout's theorem says there are at most $D^2$ solutions.
Harder question: What's a good upper bound for how many critical points $f$ has on a given straight line $Ax + By = C$? (i.e. minimum/maximum subject to the constraint $Ax + By = C$.)
Approach #1: Lagrange multipliers.
Each critical point satisfies $\nabla f = (\lambda A, \lambda B)$ for some $\lambda \in \mathbb R$. So we have a system of 3 equations $$\cases{\frac {\partial f}{\partial x}=\lambda A \\ \frac{\partial f}{\partial y}=\lambda B \\ Ax+By=C}$$ in 3 variables $x,y,\lambda$. The first two equations are polynomial of degree at most $D$ and the last one is of degree $1$. By Bezout, there are at most $D^2$ solutions.
Approach #2: Parameterize the line.
Suppose the line is given by $y=Px+Q$. Define a function $g(t)=f(t,Pt+Q)$. This is a "generic" polynomial in one variable of degree $\le D$. By "Bezout" (or just elementary algebra) there are at most $D$ solutions to $g'(t)=0$.
My question: Clearly Approach #2 gave a better result. However, I want to apply this in a harder scenario where there are more variables, more constraints, and some of the constraints are non-linear. In this scenario it seems "ugly" to parameterize the constraints like I did in approach #2, and very nice and clean to use Lagrange multipliers. But I want a better result. How do I modify the Lagrange multiplier approach to get the better bound, while avoiding parameterizing the curve (line)?