Using Maple to Approximate an Integral Use Maple to approximate the value of $b$ that solves the following equation:
$$\int_1^b \frac1x\,dx= 1$$
I picked two values $b$ such that one over approximates the integral and one which that under approximates the integral. Then I try to interpolate to obtain a new value of $b$. I was gonna try to repeat until four or five decimals remain the same. It did not work. Please help. Thanks.
 A: restart;
solve(int(1/x, x = 1 .. b) = 1, b) assuming b>1;
evalf(%,12)

A: The equation $\int_{1}^{b}\frac{dx}{x}=1$ is equivalent to $\log(b)=1$, hence the problem boils down to find accurate approximations for $e$. Since $e^x$ is a solution of the differential equation $f'=f$,
$$ e^{x}=\sum_{n\geq 0}\frac{x^n}{n!} $$
holds for every $x\in\mathbb{C}$. In particular $e$ can be approximated through
$$ \sum_{n=0}^{N}\frac{1}{n!}\qquad\text{or}\qquad \left(\sum_{n=0}^{N}\frac{(-1)^n}{n!}\right)^{-1} $$ 
for some large $N\in\mathbb{N}$. A more efficient alternative is to perform an explicit integration of functions like $x^N(1-x)^N e^{-x}$ over $(0,1)$, where such such functions are positive but pretty small. For instance, by considering $N=6$ we have
$$ \frac{1}{2^{12}}\geq \int_{0}^{1} x^6(1-x)^6 e^{-x}\,dx = 720 \left(398959-\frac{1084483}{e}\right) $$
from which we have the extremely accurate approximation $e\approx \frac{1084483}{398959}$ (the error is less than $10^{-12}$). With a similar approach, i.e. by replacing the polynomials $x^N (1-x)^N$ with the shifted Legendre polynomials $P_N(2x-1)$, we may also compute the whole continued fraction of $e$:
$$ e=[2; 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1, 1, 10, 1, 1, 12, 1, 1, 14,\ldots]$$
allowing us to compute approximations with an arbitrary accuracy.
