TITLE: How to obtain the logarithm from this numerical integral?
QUESTION [8 upvotes]: Evaluate $\int_0^1\frac{dx}{1+x}$ using the trapezoidal rule for integration and hence find the value of $\log(2)$.

I solved the first part with an interval of 0.125 and obtained: $\int_0^1\frac{dx}{1+x} ≈ 0.694075$. However, how do I find the value of $\log(2)$ in this context?

REPLY [7 votes]: You could simply translate horizontally by $1$ to the right:
$\frac{1}{1+x}$ looks the same between $0$ and $1$ than $\frac{1}{x}$ between $1$ and $2$.
So:
$$\int_0^1\frac{\mathrm{d}x}{1+x}=\int_1^2\frac{\mathrm{d}x}{x}$$
Which is $\log(2)$ by definition.