4
$\begingroup$

This is my homework question: Calculate $\int_{0}^{1}x^2\ln(x) dx$ using Simpson's formula. Maximum error should be $1/2\times10^{-4}$

For solving the problem, I need to calculate fourth derivative of $x^2\ln(x)$. It is $-2/x^2$ and it's maximum value will be $\infty$ between $(0,1)$ and I can't calculate $h$ in the following error formula for using in Simpson's formula.

$$-\frac{(b-a)}{180}h^4f^{(4)}(\eta)$$

How can I solve it?

  • 1
    The maximum value will not be $\infty$--for one thing, that isn't a value, per se, and for another, $-2/x^2$ is strictly increasing in the interval $(0,1]$, so its maximum will be achieved at 1. Note also that $b=1$, $a=0$, and $h=(b-a)/n=1/n$ is the length of the subintervals into which you're splitting $[0,1]$. Hopefully that's enough to get you unstuck.2012-05-14
  • 0
    Glad I could help out.2012-05-14
  • 3
    Unfortunately, this isn't correct. One cares about the absolute value of the derivative.2012-05-14
  • 2
    The error bound in Simpson's formula has an absolute value around the $4$th derivative. So I don't think your approach will work directly. Possibly you could estimate the integral on $[0,\epsilon]$ and then use the error bound on $(\epsilon,1)$.2012-05-14
  • 0
    /facepalm/ Excellent point. Removing my answer, now.2012-05-14
  • 0
    The major issue, then, is that it is an improper integral, since the integrand isn't defined at $x=0$. I wonder, can one apply Simpson's rule to (in this case) the integral from $\varepsilon$ to $1$, and then take $\varepsilon\to 0$? If so, then problem solved. If not, I'm blanking. Well...glad I could *try* to help out, anyway.2012-05-14
  • 0
    @CameronBuie: You can define $f(0)=0$. The value of the integrand at a single point doesn't affect the integral, and with the definition $f(0)=0$ the integrand is continuous, so it is not an improper integral.2012-05-18
  • 0
    I'm aware that there is a continuous function on the full closed interval agreeing with the integrand on the interval with the left endpoint deleted. Perhaps my understanding of the term is mistaken. I thought that when one must apply limiting behavior--either to replace the integrand with a more amiable alternative, or to slide the endpoints where they need to be, that was an improper integral. After minimal review, I conclude that I have been of no help on this post, at all. Thank you for helping me, as well, @Jonas Meyer.2012-05-18
  • 1
    @CameronBuie: I see, & I don't want to focus too much on the terminological aspect. But regardless of how $f(0)$ is defined here, this is an ordinary Riemann integral, meaning that the integral exists according to the definition of the Riemann integral of a bounded function on a bounded interval. My understanding of the usual use of the term "improper integral" is that either the function or the interval is unbounded, and hence the Riemann integral doesn't technically exist, although of a value of the integral can be obtained by taking a limit of proper Riemann integrals.2012-05-18
  • 0
    (The Riemann integral won't exist unless the function is continuous almost anywhere, but changing the values on any finite set has no effect. Now I see that my first comment was misleading, because continuity isn't really the issue for whether or not it is Riemann integrable. Oops. Continuity is convenient for considering definite bounds on $f$ in the interval $(0,\varepsilon)$, however.)2012-05-18
  • 0
    @Jonas Meyer: I am no longer confused, at this point. It really only took a cursory look at a single old textbook to remind me how rusty I've become with Calculus terminology. Apparently, I will have more studying to do this summer than I anticipated.2012-05-18
  • 0
    And, if using Lebesgue integration, one can ignore differences on any measure zero set, yes?2012-05-18
  • 0
    @CameronBuie: True, and in that case you don't get "improperness" from having unbounded functions, although sometimes you do from unbounded domains. (Standard example: $\int_0^\infty\frac{\sin(x)}{x}$ doesn't exist according to the usual Lebesgue definition, although it can be defined in the "improper" way usually applied to Riemann integration, because $\lim_{b\to\infty}\int_0^b\frac{\sin(x)}{x}$ exists.)2012-05-18

2 Answers 2

4

I will expand on copper.hat's comment. Let $f(x)=x^2\ln(x)$ on $(0,1]$, and $f(0)=0$. Note that $f$ is continuous on $[0,1]$. The first derivative of $f$ is $f'(x)=x+2x\ln(x)$. The only critical point in $(0,1)$ is at $x=1/\sqrt{e}$, and $f$ is decreasing on the interval $[0,1/\sqrt{e}]$. Therefore if $0, then $cf(c)<\int_0^cf(x)dx<0$. You can choose $c$ such that $|cf(c)|<\frac{1}{4}\times 10^{-4}$. This leaves the estimate of the integral $\int_c^1f(x)dx$, and on the interval $[c,1]$ you have $|f^{(4)}(x)|\leq |f^{(4)}(c)|=\frac{2}{c^2}$, so to choose your $h$ you can solve the inequality $\frac{(1-c)}{90c^2}h^4<\frac{1}{4}\times 10^{-4}$.

For example, $c=0.01$, $h=0.01$ would work. Simpson's rule can then be applied on the entire interval with $h=0.01$, because the error on each of $[0,0.01]$ and $[0.01,1]$ will be less than $\frac{1}{4}\times 10^{-4}$, meaning that the total error will be less than $\frac{1}{2}\times 10^{-4}$ (in absolute value).

2

As already noticed, $f(x)$ is not $C^4$ on the closed interval $[0,1]$, and a direct estimate on the error in Simpson's method is troublesome. One way to handle things is to remove the left end point as described by Jonas Meyer. Another way to handle weak singularities as these is to start with a change of variables.

For this particular integral, you can check that the substitution $x = t^a$ for $a$ large enough will turn the integrand into a $C^4$ function. For example, $a = 2$ gives $x = t^2$, $dx = 2t\,dt$, so

$$\int_0^1 x^2 \ln(x)\,dx = \int_0^1 t^4 \ln(t^2)\,2t\,dt= 4\int_0^1 t^5\ln(t)\,dt.$$

Let $g(t) = t^5\ln(t)$. You can check that $g(t)$ is $C^4$ on $[0,1]$. (Extended to $g(0) = 0$, of course.) Furthermore $|g^{(4)}(t)| \le 154$ on $[0,1]$. Simpson's rule on $g$ now works (reasonably) well.