How do I calculate $\int_1^3$ $x \ln (x)\ dx$ with a given accuracy, using Simpson's rule?

272 Views Asked by At

How do I calculate $\int_1^3 x \ln (x)\ dx$ with a given accuracy, in this case $10^{-4}$ using Simpson's rule? The problem I encounter is that the fourth derivative is $=2/x^3$. So how do I go forward to solve $(32/180\cdot n^4)\cdot (2/x^3)$ $\le 10^{-4}$ ? Or am I completely on the wrong track here?

1

There are 1 best solutions below

0
On BEST ANSWER

As stated in the comments, the fourth derivative of $x\log x$ on $[1,3]$ is bounded by $2$ in absolute value, hence in order to approximate $\int_{1}^{3}x\log(x)\,dx = -2+\frac{9}{2}\log 3$ within $10^{-4}$ it is enough to apply Simpson rule with respect to a uniform partition of $[1,3]$ in $n$ components, such that $$ \frac{M(b-a)^5}{180 n^4}=\frac{16}{45 n^4}\leq 10^{-4}. $$ The least $n$ ensuring such inequality is $n=8$, leading to $$ -2+\frac{9}{2}\log(3)\approx \frac{1}{12}\left[f(1)+4 f\left(\tfrac{5}{4}\right)+2 f\left(\tfrac{3}{2}\right)+4 f\left(\tfrac{7}{4}\right)+2 f\left(2\right)+4 f\left(\tfrac{9}{4}\right)+2 f\left(\tfrac{5}{2}\right)+4f\left(\tfrac{11}{4}\right)+f(3)\right]=\color{green}{2.9437}7\ldots$$ with an actual error of $\approx 1.85\cdot 10^{-5}$.


Now, to use values of $\log$ over $[1,12]$ for approximating $\log(3)$ is a bit awkward.
If you want to avoid such circularity, you may notice that $$ \int_{0}^{1}\frac{P_5(2x-1)}{1+2x}\,dx = \frac{3061}{30}-\frac{743}{8}\log(3)$$ provides a rational approximation of $\log(3)$, namely $\frac{12244}{11145}=[\color{green}{1; 10, 7}, \color{red}{11, 14}]$, within an error of $10^{-5}$. It follows that $$ \frac{10936}{3715}=[2; 1, 16, 1, 3, 2, 4, 5]=\color{green}{2.9437}41588\ldots $$ is a rational approximation of the given integral within $10^{-4}$.