Solution (source code)

= Solution

Differentiating under the <contour integration> sign gives
$$
zw''+w=\int_\gamma e^{zt}\bigl(zt^2f(t)+f(t)\bigr)\,dt.
$$
Since $\partial_t e^{zt}=ze^{zt}$, <integration by parts> turns this into
$$
\left[e^{zt}t^2f(t)\right]_{\partial\gamma}
+\int_\gamma e^{zt}\left[f(t)-\frac{d}{dt}\bigl(t^2f(t)\bigr)\right]dt.
$$
The integral vanishes when
$$
(t^2f)'=f,
\qquad
\frac{f'}f=\frac1{t^2}-\frac2t.
$$
Hence, up to an irrelevant multiplicative constant,
$$
\boxed{f(t)=t^{-2}e^{-1/t}.}
$$
The remaining endpoint condition is
$$
\boxed{\left[e^{zt-1/t}\right]_{\partial\gamma}=0.}
$$
\b[Thus each open end of $\gamma$ must lie where $\operatorname{Re}(zt-1/t)\to-\infty$; a closed contour also makes the boundary term vanish when the integrand is single-valued along it.]