I have some function of $R^2$, that must be numerically computed. For instance, I might be interested in a real-valued contour integral that begins from (x,y) = 0.
$$ f(x,y) = \Re\left[\int_0^{x + iy} t^3 + t^5 \, dt \right] $$
where $\Re$ is for the real part. (In practice I don't have the explicit form for f and it must be numerically computed). The contours $f = 0$ look like:
I know that there exists some continuous and smooth curve that leaves the origin, and for all points along this curve $x = x(s)$, $y = y(s)$, that $f = 0$ where $s$ is is some parameterization.
I also know a good initial guess to use for the initial direction of this line. For instance, I might know that initially, the curve leaves along some direction, $\theta$.
How do I numerically solve for the curve?
One way is to just compute $f$ over a grid of values in $x$ and in $y$. Then create a contour plot and interpolate for all constant-value contours satisfying f = 0. This is not a computationally friendly way.
Another way might be to start at (x,y) = (0,0) and take a small step in the direction of your guess of where the curve lies. Then from this new point, take another small step, but in a direction that minimizes $f$.
The problem with 2. is that I'm not sure how to code something adaptive (I'd like to take variable step sizes, particularly around regions where the curve may be highly-curved).
I'm sure there must be well-known numerical methods for these problems. This is really just root-finding but with the advantage that you know the solution set (that you are interested in) must be continuous and smooth. Can someone lend a hand?