Solution (source code)

= Solution

Neglect ends and take the exterior as vacuum. With polar angle measured from the applied field, regularity inside and the far-field condition allow
$$
\phi_{\rm in}=-B E_0s\cos\theta,\qquad
\phi_{\rm out}=-E_0s\cos\theta+A E_0a^2\frac{\cos\theta}{s}.
$$
Continuity of potential gives $B=1-A$; continuity of normal electric <displacement>, with no free surface charge, gives $\epsilon_rB=1+A$. Hence the <transverse electrostatic field inside a dielectric cylinder> is uniform, parallel to the applied field, with magnitude
$$
\boxed{E_{\rm in}=\frac{2E_0}{1+\epsilon_r}.}
$$
This cylindrical result differs from the spherical depolarization factor. It returns $E_0$ for $\epsilon_r=1$ and tends to zero for large positive $\epsilon_r$.