How do I fit $f(x) = \exp(a+bx+cx^2 +dx^3)$ to two points? $x, f(x)$ and $f'(x)$ are known. In the past I've fit polynomials by solving the set of equations.  I can fit $f(x) = \exp(a+bx)$ to point $A$ and $B$ where I know $x$ and $f(x)$ for both points.  
If I want to fit to a specific gradient at point $A$ and $B$, I can use $f(x) = \exp(a+bx+cx^2 +dx^3)$ - so I know $x, f(x)$ and $f'(x)$ at point $A$ and point $B$.
Do I have to solve this using the Levenberg-Marquardt algorithm (or something similar) or is there a simpler/more efficient way?
Cheers
 A: You have $$y = \exp(a+bx+cx^2 +dx^3)$$ $$y'=(b+2cx+3dx^2)\,\exp(a+bx+cx^2 +dx^3)$$ and you know ($x_1,y_1,y'_1$), ($x_2,y_2,y'_2$) so the four equations are $$y_1 = \exp(a+bx_1+cx_1^2 +dx_1^3)$$ $$y_1'=(b+2cx_1+3dx_1^2)\,\exp(a+bx_1+cx_1^2 +dx_1^3)$$ $$y_2 = \exp(a+bx_2+cx_2^2 +dx_2^3)$$ $$y_2'=(b+2cx_2+3dx_2^2)\,\exp(a+bx_2+cx_2^2 +dx_2^3)$$ So $$r_1=\frac{y_1'}{y_1}=b+2cx_1+3dx_1^2$$ $$r_2=\frac{y_2'}{y_2}=b+2cx_2+3dx_2^2$$ These two equations allow to eliminate $b$ and $c$. 
Similarly, since $b$ and $c$ have been already expressed as linear functions of $d$, solving $$\log(y_1)=a+bx_1+cx_1^2 +dx_1^3$$ $$\log(y_2)=a+bx_2+cx_2^2 +dx_2^3$$ would give $a$ and $d$.
For sure, you could do faster using matrix calculations since you reduced the problem to four linear equations for four unknowns $a,b,c,d$ namely
$$r_1=\frac{y_1'}{y_1}=b+2cx_1+3dx_1^2$$ $$r_2=\frac{y_2'}{y_2}=b+2cx_2+3dx_2^2$$
$$r_3=\log(y_1)=a+bx_1+cx_1^2 +dx_1^3$$ $$r_4=\log(y_2)=a+bx_2+cx_2^2 +dx_2^3$$
Hoping no mistakes, the expressions are rather simple 
$$d=\frac{r_1+r_2}{(x_1-x_2)^2}+\frac{2 (r_4-r_3)}{(x_1-x_2)^3}$$
$$c=\frac{r_1-r_2}{2 (x_1-x_2)}-\frac{3}{2} d (x_1+x_2)$$
$$b=-2 c x_1-3 d x_1^2+r_1$$
$$a=-b x_2-c x_2^2-d x_2^3+r_4$$
