[GRE 1268, #21a]
Find the value of \(\displaystyle \int_{-1}^1 |x| \left(x^2+\sin\left(x^3\right)\right) dx\).
Solution
The function inside the integral looks quite complicated. In fact, there is no way to find the indefinite integral
of \(\sin(x^3)\). But we don't need to do that. The key to this problem is to notice that the integral is of the form
\(\int_{-c}^c f(x) dx.\) When you see this, think of even and odd functions.
A function \(f(x)\) is called even if \(f(-x)=f(x)\), and odd if \(f(-x)=-f(x)\). So for example
\(x^2, x^4, |x|, \cos x, \sec x\) are even functions (because \((-x)^2 = x^2, |-x|=|x|, \cos(-x)=\cos x, \sec(-x)=\sec x\))
and \(x,x^3, \sin x, \tan x\) are odd functions (because \((-x)=-x, (-x)^3 = - x^3, \sin(-x) = -\sin x, \tan(-x)=-\tan x\)).
The crucial property of even and odd functions useful for this problem is the following:
\[\mbox{If \(f(x)\) is even, then } \int_{-c}^c f(x) dx = 2 \int_0^c f(x) dx .\]
\[\mbox{If \(f(x)\) is odd, then } \int_{-c}^c f(x) dx = 0.\]
Both properties are easily understood thinking about the graphs. Remember that \(f(-x)\) is the graph of \(f(x)\) reflected
across the \(y\)-axis. So \(f(x)\) even means that the reflected graph will look exactly the same. This means that the area
between \(-c\) and \(0\) will be the same as the area between \(0\) and \(c\). So the area between \(-c\) and \(c\)
will be twice the area between \(0\) and \(c\). On the other hand, if \(f(x)\) is odd, it means that when we reflect
across the \(y\)-axis we get the negative of the graph. This means that the area between \(-c\) and \(0\) will have the
same size, but opposite sign as the area between \(0\) and \(c\). So the two areas cancel and the integral from \(-c\) to \(c\)
will be zero. You should draw some pictures to illustrate what happens in each case.
We can now easily do the given problem. First of all we split it into two:
\[\int_{-1}^1 |x| \left(x^2+\sin\left(x^3\right)\right) dx=\int_{-1}^1 |x|x^2dx + \int_{-1}^1 |x|\sin\left(x^3\right) dx.\]
Then we notice that the function in the first integral is even:
\[|-x| (-x)^2 = |x|x^2\]
and the function in the second integral is odd:
\[|-x|\sin((-x)^3) = |x|\sin(-x^3)=-|x|\sin(x^3).\]
This means that the integral from \(-1\) to \(1\) of the second function (the difficult one) is just zero, and the integral of
the first function is
\[2\int_0^1 |x|x^2 dx.\]
But on the interval \([0,1]\) \(x\) is positive, so we can just drop the absolute value sign, and the first integral is
\[2\int_0^1 xx^2dx=2\int_0^1x^3dx = 2 \left[ \frac{x^4}{4}\right]_0^1= \frac{1}{2}.\]