Finding the derivative of $f(x)=\int_1^{\infty}\frac{e^{-xy}}{y^2}dy,\:\:\:x\in(0,\infty)$ 
Let 
  $$f(x)=\int_1^{\infty}\frac{e^{-xy}}{y^2}dy,\:\:\:x\in(0,\infty)$$
  Show that $f(x)$ is differentiable on $(0,\infty)$, find the formula for $f'(x)$? Is $f(x)$ twice differentiable?

I'm thinking to define a sequence as follow
$$f_n(x)=\int_1^n\frac{e^{-xy}}{y^2}dy.$$
To show $f_n(x)$ is differentiable, I'm thinking to show the following limit exists,
$$\lim_{h\to 0}\int_1^n\frac{e^{-(x+h)y}-e^{-xy}}{y^2h}.$$
To be able to pass the limit inside the integral, we can apply the Lebesgue dominated convergence theorem. So I want to see if  I can apply it. Since $\frac{e^{-(x+h)y}-e^{-xy}}{y^2h}$ is bounded by $\frac{e^{-uy}}{y}$, (where $x\leq u\leq x+h$) which is integrable on $[1,\infty).$
Hence $f'_n(x)=\int_1^n\frac{d}{dx}(\frac{e^{-xy}}{y^2})dy=\int_1^n-\frac{e^{-xy}}{y}dy. $
Now, $\lim_{n\to\infty}\int_1^n\frac{-e^{-xy}}{y}dy=\int_{1}^{\infty}\frac{-e^{-xy}}{y}dy.$
However I see a problem here, since in fact, we have 
$$f'(x)=\lim_{h\to 0}\lim_{n\to{\infty}}\int_1^n\frac{e^{-(x+h)y}-e^{-xy}}{y^2h}.$$
But I'm not sure, if I'm allowed to interchange these two limits. I appreciate any hint or alternative proof. 
 A: Let's take two derivatives under the integral first, and we will talk about justifying it after the fact.
Consider $$f(x) = \int_1^\infty \frac{e^{-xy}}{y^2} dy.$$
Then two derivatives with respect to $x$ are easy to take here:
$$f^{\prime\prime}(x) = \int_1^\infty e^{-xy} dy = -\left.\frac{e^{-xy}}{x} \right|_{1}^\infty = \frac{e^{-x}}{x}.$$

Note that the denominator gets completely cancelled by the chain rule. Hence, (provided we can justify the derivatives) we have $$f^{\prime}(x) = \int \frac{e^{-x}}{x} dx = e^{-x}\ln(x) + \int_1^x \ln(\tau)e^{-\tau}d\tau + C$$ for some $C \in \mathbb{R}$.
Finally, we can see that as $x \to \infty$ that $f'(x) \to 0$. We conclude that $f'(x) = e^{-x}\ln(x) + \int_1^x \ln(\tau)e^{-\tau}d\tau$.

To justify passing the derivative through the integral, we can appeal to the measure theory version of the Leibniz integral rule.
What we need is a function that bounds $g(x,y) = \frac{d}{dx} \frac{e^{-xy}}{y^2} = -\frac{e^{-xy}}{y}$ independent of $x$ that is also integrable. For any $\delta > 0$, we have $$|g(x,y)| \le \frac{e^{-\delta y}}{y}$$ for all $x \in [\delta, \infty)$. Therefore, given $x > \delta$, we have $$\frac{d}{dx} \int_1^\infty \frac{e^{-xy}}{y^2} dy = \int_1^\infty \frac{d}{dx}\left( \frac{e^{-xy}}{y^2} \right) dy.$$ Since, $\delta$ was chosen to be an arbitrary positive number, we may conclude that this formula holds for all $x > 0$. A similar argument can be performed for the second derivative as well.
A: By Fubini's theorem,$$
f(x) = \int_1^{+\infty} \frac{\mathrm{e}^{-xy}}{y^2} \,\mathrm{d} y = \int_1^{+\infty} \int_x^{+\infty} \frac{\mathrm{e}^{-uy}}{y} \,\mathrm{d} u\,\mathrm{d} y = \int_x^{+\infty} \int_1^{+\infty} \frac{\mathrm{e}^{-uy}}{y} \,\mathrm{d} y\,\mathrm{d} u,
$$
thus$$
f'(x) = -\int_1^{+\infty} \frac{\mathrm{e}^{-xy}}{y} \,\mathrm{d} y.
$$
