# Strategies to solve an equation with a polynomial and a numeric function

I have to solve numerically an equation of the following form:

$$\sum_{n=0}^m c_n x^n = f(x) x^k$$

Where the $$c_n$$ are real values, $$k$$ is an integer and $$f$$ can only be evaluated numerically.

The current implementation in our code is using a numerical approach (specifically using scipy.optimize.brentq) but I wondered:

• If I could find all the roots somehow
• If there was known strategies that exploit the polynomial parts.

EDIT: I realized I have a few properties on $$f$$:

• $$f$$ is in $$C^\infty(\Bbb{R}, \Bbb{R})$$
• $$f$$ is monotonous (non increasing)
• $$\lim_{x\rightarrow+\infty} f(x) = -\infty$$
• $$\lim_{x\rightarrow-\infty} f(x) = +\infty$$
• So on LHS it is a known polynomial function, on RHS something that is just a "black box" function, we don't know the properties of f(x), only numerical values? Then in general we cannot find all the roots because we don't even know how many of them are there; also, it can be an infinite number of roots . Commented Feb 23, 2023 at 17:53
• Are you maybe trying to find a representation of $f(x)$ with monomials, is this really a root finding problem?
– Bort
Commented Feb 23, 2023 at 18:38
• @MaximUmansky ok, I expected that actually, but had hope that I didn't know something. I think I can actually prove some useful things, namely it should change sign and may even be monotonous. I also think it is continuous but I have to prove it.
– WIP
Commented Feb 24, 2023 at 9:18
• @Bort It is really a root finding problem, I'm not actually concerned about $f$.
– WIP
Commented Feb 24, 2023 at 9:19
• Unfortunately, even if the function f is monotonic this does not rule out the possibility of infinite number of roots; consider the example x = f(x) where f(x)=x+$\epsilon$sin(x). Commented Feb 24, 2023 at 16:44