How would one in general go about finding some polynomial $\Pi$ defined on say $[a, b]$ such that
- $\Pi(a) = \Pi(b) = 0$,
- $\Pi'(a) = d_a, \Pi'(b) = d_b$ ($d_a, d_b$ fixed in advance) and
- $\text{sgn}(\Pi)$ is continuous on $(a, b)$ (that is $\Pi$ does not switch sign or become zero in between the fixed roots $a, b$).
You can find cubic polynomials $f$ and $g$ that are zero at $a$ and $b$, are positive on $(a,b)$ and such that $f'(a) = 1$, $f'(b) = 0$, $g'(a) = 0$, and $g'(b) = 1$. (Hint: $f$ is a multiple of $(x-a)(x-b)^2$.) Then $\Pi = d_a f - d_b g$ will do the job (since $d_a$ and $d_b$ must have opposite signs if they are both nonzero).
If $d_a = d_b = 0$ and you don't consider $\Pi = 0$ to be valid, then you can use a quartic polynomial like $(x-a)^2(x-b)^2$.