Assume I have given a function, in my problem it would be
$$ f(x) = c_1 e^{r_1 x} + (c_1 x)^3 - (c_2 x)^2 $$
and I have a list of function values $f(x)$ for x from $0$ to $20$.
How can I effectively search for $c_1, c_2$ and $r_1$ without just trial and error?
The data provided by Marcel is :
[0.2, -0.142682939241718, -0.886680607211679, -2.0095087143494, -3.47583798747496, -5.24396052331554, -7.2690008846359, -9.50451068338581, -11.9032604272567, -14.4176327390446, -16.9998176236069, -19.6019094345634, -22.1759550265352, -24.6739776668383, -27.0479889096801, -29.2499944927101, -31.2319972651608, -32.945998641919, -34.3439993255969, -35.3779996651013, -35.9999998336943, -36.161999917415, -35.8159999589895, -34.9139999796348, -33.4079999898869, -31.249999994978, -28.3919999975061, -24.7859999987616, -20.383999999385, -15.1379999996945] for x=[0,29] (integer)
And we know that the scatter is very low, so, the data is quite exact.
This is a very particular case, since the first point $(x=0,y=0.2)$ gives a first approximate of $$c_1\simeq 0.2$$ We will see later that it's in fact an exact value. $$y(x)=c_1e^{r_1x}+c_1^3x^3-c_2^2x^2$$
Moreover, for large values of $x$ the term $x^3$ is big. A first approximate of $c_2$ can be derived in considering as quite exact $(x=29,y=y_{29})$ and negligible the term $c_1e^{r_1x_{29}}$ : $$y_{29}\simeq c_1^3x_{29}^3-c_2^2x_{29}^2 \quad\to\quad c_2^2\simeq \frac{(0.2)^3 (29)^3-(-15.1379999996945)}{(29)^2}\simeq 0.250000$$ $$c_2\simeq 0.500000$$ The equation to be fitted becomes : $$y(x)-0.008x^3+0.25x^2\simeq 0.2e^{r_1x}$$ The regression for only one parameter $r_1$ is straightforward considering the linear relationship of the logarithms : $$r\simeq \frac{1}{28}\sum_{k=1}^{k=28}\ln{\frac{y_k-c_1^3x_k^3+c_2^2x_k^2}{c_1}}\simeq -0.701379$$ Note that the numbering of the points is from $k=0$ to $k=29$, so that $x_k=k$.
The first point $(k=0)$ and the last point $(k=29)$ are not included in the sum because they where used to compute $c_1$ and $c_2$ respectively : $y-c_1^3x^3+c_2^2x^2=0$ exactly, for those two points.
The first approximate result is : $\quad c_1\simeq 0.200000 \quad c_2\simeq 0.500000 \quad r_1\simeq -0.701379$
Further calculus (non-linear regression) leads to the exact result : $$\quad c_1= 0.2 \quad c_2= 0.5 \quad r_1= -0.7$$
That is the result prematurely mentioned in one of my comments. This answer shows how it was obtained.
Of course, this method is not valuable in all cases. This was possible only because the data is particular as noted at the beginig.