Given two circles with radii $R_L$ and $R_R$ and centers at $(-(R_L+a),\,0)$ and $(R_R+a,\,0)$, respectively, find a cubic polynomial $p(x)=b+cx^2+dx^3$ that smoothly connects the two circles.
$b$ is a parameter so $p(0)=b$ and the linear term of the polynomial is omitted because we want $\frac{\mathrm{d}p}{\mathrm{d}x}\Big|_{x=0}=0$.
My attempt at a solution. Let $\mathrm{C}_{L,R}$ the equations for the upper half of the $L,R$ circles. I formulate two equations relating $\mathrm{C}_{L,R}$ and $p$, and two equations relating $\frac{\mathrm{d}}{\mathrm{d}x}\mathrm{C}_{L,R}$ and $\frac{\mathrm{d}p}{\mathrm{d}x}$. Let $x_{L,R}$ be the points where $p(x)$ and $\mathrm{C}_{L,R}(x)$ intersect, then:
$$ \mathrm{C}_L(x_L)-p(x_L) = 0 $$ $$ \mathrm{C}_R(x_R)-p(x_R) = 0 $$ $$ \frac{\mathrm{d}}{\mathrm{d}x}\mathrm{C}_L(x_L) - \frac{\mathrm{d}p}{\mathrm{d}x}(x_L) = 0 $$ $$ \frac{\mathrm{d}}{\mathrm{d}x}\mathrm{C}_R(x_R) - \frac{\mathrm{d}p}{\mathrm{d}x}(x_R) = 0 $$ so I have a system of four nonlinear equations with four unknowns $(x_L,\,x_R,\,c,\,d)$. I coded a simple Newton's method for the system and it works well for some combinations of parameters $(a,\,b,\,R_L,\,R_R)$ when the initial guess is close enough, especially when $|R_L-R_R|$ is not too large and I use a constant damping for the Newton iterations. I can find initial guesses that I think are good via a graphical interface I coded. However, as $|R_L-R_R|$ gets larger the solver fails spectacularly to converge even with very close initial guesses and very small damping. (I should add that I'm actually taking the square of the equations to avoid square roots of negative numbers during the Newton iterations).
My question is threefold:
a) what other method or modification can I use to make the solver more stable?
b) this problem seems to me like it should be solved somewhere, do you know a reference?
c) more generally, is there a reason this should fail as horribly as it does when $|R_L-R_R|>>1$?