Someone asked me for a formula for the sum of the harmonic progression. So I did some calculations and gave him an approximate formula:
$$\int_1^n\frac{dx}{x} = \frac{y_1 + y_2}{2} + \frac{y_2 + y_3}{2} + \cdots +\frac{y_{n-1} + y_n}{2}$$ where $y_i$ is $i$th term of the HP $$\ln(n) = \frac{y_1}{2} + y_2 +y_3 + \cdots +\frac{y_n}{2}$$
so
$$\sum_{i=1}^n y_i = \ln(n) + \frac{y_1 + y_n}{2}$$
e.g. $1+1/2+\cdots+1/10 = 2.8525 $
actual result $= 2.9289$
My question is, how to correct this formula?