Polynomials with integration problem 
Are there polynomials $P,Q$ with real coefficients satisfying the equalities 
$$\int_0^{\ln n}\frac{P(x)}{Q(x)} \, dx
= 1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n}$$
for each integer $n\ge 2$? 

I don't know how I show the existence of such polynomials or nonexistence. I took some example but I can't improve anything.
 A: Suppose there existed such $P,Q$. It is easy to see that $\deg P\le \deg Q$; otherwise the integral will blow up too quickly. This implies that $\frac{P(1/z)}{Q(1/z)}$ is a rational function which does not blow up at $0$, and hence has a Taylor expansion $\frac{P(1/z)}{Q(1/z)} = a_0+a_1z+a_2z^2+\dots$ valid for all small enough $z$. This implies that
$$ \frac{P(x)}{Q(x)} = a_0 + \frac{a_1}{x} + \frac{a_2}{x^2} + \dots $$
for all large enough $x$. I will now show that $a_0 = 1 $ and $a_k = 0$ for $k>0$, so that $\frac{P(x)}{Q(x)} = 1$, which is incompatible with the requirement that $\int\limits_{0}^{\ln n}{\frac{P(x)}{Q(x)}\,dx} = 1 + \frac{1}{2} + \dots + \frac{1}{n}$ for $n\ge 2$.
For $k\ge 0$, notice that
$$\frac{1}{(\ln(n+1))^k}\ln\left(\frac{n+1}{n}\right)\le\int_{\ln n}^{\ln(n+1)}{\frac{1}{x^k}\,dx}\le\frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right). $$
Furthermore, since
$$\frac{1}{(\ln n)^k}-\frac{1}{(\ln(n+1))^k} = \int_{\ln n}^{\ln(n+1)}{\frac{k}{x^{k+1}}\,dx}\le\frac{k}{(\ln n)^{k+1}}\ln\left(\frac{n+1}{n}\right) $$
it follows that
\begin{align} \left|\int_{\ln n}^{\ln(n+1)}{\frac{1}{x^k}\,dx} - \frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right)\right|&\le\left(\frac{1}{(\ln n)^k}-\frac{1}{(\ln(n+1))^k}\right)\ln\left(\frac{n+1}{n}\right) \\
&\le\frac{k}{(\ln n)^{k+1}}\left(\ln\left(\frac{n+1}{n}\right)\right)^2
\end{align}
and hence $\int\limits_{\ln n}^{\ln(n+1)}{\frac{1}{x^k}\,dx} = \frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right)(1+o(1))$.
Now, to show $a_0 = 1$, notice that
\begin{align} \int_{\ln n}^{\ln(n+1)}{\frac{P(x)}{Q(x)}\,dx} &= \int_{\ln n}^{\ln(n+1)}{a_0+O\left(\frac{1}{x}\right)\,dx} \\
&= a_0\ln\left(\frac{n+1}{n}\right) + O\left(\frac{1}{\ln n}\ln\left(\frac{n+1}{n}\right)\right) \\
&= \frac{a_0}{n} + o\left(\frac{1}{n}\right).
\end{align}
In order for $\int\limits_{\ln n}^{\ln(n+1)}{\frac{P(x)}{Q(x)}\,dx} = \frac{1}{n+1} = \frac{1}{n}(1+o(1))$ for all $n$, it follows that we must have $a_0 = 1$.
We now show $a_k = 0$ for $k>0$ by induction. Suppose $a_j = 0$ for all $0<j<k$ (note for the base case $k=1$ that this is vacuously true). Then
$$\frac{P(x)}{Q(x)} - 1 = \frac{a_k}{x^k} + \frac{a_{k+1}}{x^{k+1}} + \dots = \frac{a_k}{x^k} + O\left(\frac{1}{x^{k+1}}\right) $$
and hence
\begin{align} \int_{\ln n}^{\ln(n+1)}{\frac{P(x)}{Q(x)}-1\,dx} &= \int_{\ln n}^{\ln(n+1)}{\frac{a_k}{x^k}+O\left(\frac{1}{x^{k+1}}\right)\,dx} \\
&=\frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right)(a_k+o(1)) + O\left(\frac{1}{(\ln n)^{k+1}}\ln\left(\frac{n+1}{n}\right)\right) \\
&=\frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right)(a_k+o(1)).
\end{align}
By assumption, we have
$$\int_{\ln n}^{\ln(n+1)}{\frac{P(x)}{Q(x)}-1\,dx} = \frac{1}{n+1} - \ln\left(\frac{n+1}{n}\right) = O\left(\frac{1}{(n+1)^2}\right)$$
and $\frac{1}{(n+1)^2} = o\left(\frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right)\right)$ for any $k>0$. It follows that
$$\frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right)(a_k+o(1)) = \frac{1}{(\ln n)^k}\ln\left(\frac{n+1}{n}\right)o(1)$$
which yields $a_k = 0$, as desired.
A: Not an answer, but an idea. If such a pair of polynomials exist, then it would follow that $$\int_{0}^{\infty}\Big(\dfrac{P(x)-Q(x)}{Q(x)}\Big)dx = \lim_{n\to\infty}(H_n - \ln n) = \gamma,$$
where $\gamma$ is the Euler-Mascheroni constant. But looking at this page, it does not look very likely that $\gamma$ has an integral representation where the integrand is real, rational function. 
Maybe someone can continue this idea and prove the question in the negative. 
