Can we have a simple root of real polynomials with coefficients as linear functions such that the curve of the root is tangent to imaginary axis? Let us consider a parametrized polynomial
\begin{align*}
f(x, r) = x^n + ra_{n-1} x^{n-1} + \dots + ra_0,
\end{align*}
where $r \in \mathbb R$ is the parameter and $a = (a_{n-1}, \dots, a_0)$ is fixed. Alternatively, we can consider $f(x) \in \mathbb R[x]$ with coefficients as linear functions over $\mathbb R$
\begin{align*}
f(x, r) = x^n + a_{n-1}(r) x^{n-1} + \dots + a_0(r).
\end{align*}
Since $r \in \mathbb R$, there exists $n$ continuous functions $b_1(r), \dots, b_n(r)$ such that for each $r$, $\{b_1(r), \dots, b_n(r)\}$ is the set of roots for $f(x,r)$ counting multiplicity. Now suppose for $r_0 \in \mathbb R$ and some $b \in \mathbb R$, $f(bi, r_0) = 0$ where $i$ denotes imaginary symbol. Further assume at $r_0$, $bi$ is a simple root. So at least locally around $r_0$ (if I am not mistaken), we should have a smooth function that tracks this root. Let us call this function $\gamma(r)$.
My question is: is it possible that the curve $\gamma(r)$ is tangent to the imaginary axis at $r_0$? Here is a plot to demonstrate what I have in mind. Note the plot is a parabola, but the shape is really not important. I only need the very local behavior about $r_0$. 


This is related to a question I asked here Can roots of a polynomial stay on one side of the complex plane as the coefficients vary?
 A: Yes, it is possible. Try
$$
p_r (x) = x^5+r(2x^4+5x^3+4x^2+4x+2).
$$Let $\epsilon = r-1$ and write $p_r(x) = 0$ as
$$
x^5+2x^4+5x^3+4x^2+4x+2 = -\epsilon (2x^4+5x^3+4x^2+4x+2)\quad\cdots (*).
$$ At $\epsilon = 0$, we see that $x= i$ is a root of $(*)$. And a numerical plot shows that $\gamma(1+\epsilon)$ has a positive real part for all $\epsilon$ with sufficiently small absolute value. You can check this easily on the web using https://www.wolframalpha.com/.
$\textbf{EDIT:}$ Here's how I got this example. First, we can without loss of generality, assume that $r_0 = 1$ (through rescaling) and thus any such example is of the form of $(*)$:
$$
x^n + b_{n-1}x^{n-1} + \cdots + b_1x + b_0 = -\epsilon (b_{n-1}x^{n-1} + \cdots + b_1x + b_0)=-\epsilon Q(x)\quad\cdots(**).
$$ We can further assume that $x=i $ is a root of $(**)$ when $\epsilon=0$. That is, $i^n + Q(i)=0$. Secondly, we have
$$
\gamma(1+\epsilon) = i -\epsilon \frac{Q(i)}{ni^{n-1}+ Q'(i)}+\mathcal{o}(\epsilon),
$$ and hence $\gamma'(1) = -\frac{Q(i)}{ni^{n-1}+ Q'(i)} =i\beta$ for some real $\beta$. It is recommended to choose a high $n$ to produce such a plot in your figure. On the other hand, choosing a high $n$ produces too many coefficients to be determined. My choice was $n=5$. So, let $Q(x) = ax^4 + bx^3 + cx^2 +dx +e$ and do the calculation using $i + Q(i)=0$ and $-\frac{Q(i)}{5+ Q'(i)} = \frac{i}{5+ Q'(i)}=i\beta.$ This yields:
$$
(a-c+e) +i(-b+d+1) =0,
$$
$$
(-3b +d+5)+i(-4a+2c) =\frac{1}{\beta}=\beta'.
$$ This gives restrictions on the coefficients:
$$
c=2a, e=a, d=b-1,
$$ and $a,b$ are free variables. Finally, choose arbitrary $(a,b)$ and execute the test whether it produces such a plot. You may be able to find many other examples using this method.
