Someone told me to find extremum of a function in form of $f(x) = (x-a)^n (x-b)^m$ we can use this method: (this a method so that we can find the extremum without using the derivative) ($n$ and $m$ are not necessarily natural numbers and can be any real number) $$x_{ext} = \frac{ma+nb}{m+n}$$ i.e. we calculated the weighted mean of roots where their weights are the degree of the other term.
I want to know that does this method have any name for example name of a mathematician or something else? And I also want to know can this method be somehow generalized into polynomial functions with more than two roots i.e. $(x-a)^n(x-b)^m(x-c)^p ...$ ? If yes, how?
This result is reached by differentiation.
By the Product Rule, $$f'(x)=n(x-a)^{n-1}(x-b)^m+m(x-a)^n(x-b)^{m-1}=0$$ for extrema. Dividing gives $$n(x-b)+m(x-a)=(m+n)x-(ma+nb)=0\implies \boxed{x=\frac{ma+nb}{m+n}}$$ as you have.
For generalisation, you can repeatedly use the Product Rule, giving $$ f'(x)=n(x-a)^{n-1}(x-b)^m(x-c)^p...+m(x-a)^n(x-b)^{m-1}(x-c)^p...+p(x-a)^n(x-b)^m(x-c)^{p-1}...+...=0$$ and simplifying gives $$n(x-b)(x-c)...+m(x-a)(x-c)...+p(x-a)(x-b)...=0$$ This becomes difficult to solve as the number of products increases - there is no general form for the solution of a quintic.