Home » Blog » Compute an integral of |(x-1)(3x-1)|

Compute an integral of |(x-1)(3x-1)|

Compute

    \[ \int_0^2 \left|(x-1)(3x-1)\right| \, dx. \]


Since we are taking the integral of an absolute value, we want to break the expression in the absolute value into intervals on which it is either always positive or always negative, and evaluate the integrals of the pieces separately. So, examining |(x-1)(3x-1)| we have zeros of (x-1)(3x-1) at x = 1, \frac{1}{3}. If the expression is going to change sign it must do so at these points. So,

    \begin{align*}  x < \frac{1}{3} && \implies && (x-1)(3x-1) > 0 && \implies && |(x-1)(3x-1)| &= (x-1)(3x-1) \\  \frac{1}{3} < x < 1 && \implies && (x-1)(3x-1) < 0 && \implies && |(x-1)(3x-1)| &= -(x-1)(3x-1) \\  x > 1 && \implies && (x-1)(3x-1) > 0 && \implies && |(x-1)(3x-1)| &= (x-1)(3x-1). \end{align*}

So, we break the integral into pieces (which we can do since the integral is additive with respect to the interval of integration by Theorem 1.17 of Apostol),

    \[  \int_0^2 \left| (x-1)(3x-1) \right| \, dx &= \int_0^{1/3} (x-1)(3x-1) \, dx + \int_{1/3}^1 -(x-1)(3x-1) \, dx + \int_1^2 (x-1)(3x-1). \]

Now we can use the formula for the integral of a polynomial to calculate each of these separately,

    \begin{align*}  \int_0^{1/3} (x-1)(3x-1) \, dx &= \int_0^{1/3} (3x^2 - 4x + 1) \, dx \\  &= \left. \left( 3 \frac{x^3}{3} - 4 \frac{x^2}{2} + x \right) \right|_0^{1/3} \\  &= \left( \frac{1}{27} - \frac{2}{9} + \frac{1}{3} \right) - 0 \\  &= \frac{4}{27} \\ \int_{1/3}^1 -(x-1)(3x-1) \, dx &= -\int_{1/3}^1 (3x^2 - 4x + 1) \, dx \\  &= - \left. \left( 3 \frac{x^3}{3} - 4 \frac{x^2}{2} + x \right) \right|_{1/3}^1 \\  &= - \left( (1-2 + 1) - \left(\frac{1}{27} - \frac{2}{9} + \frac{1}{3} \right) \right) \\  &= \frac{4}{27} \\ \int_1^2 (x-1)(3x-1) \, dx &= \int_1^2 (3x^2 - 4x + 1) \, dx \\  &= \left. \left( 3 \frac{x^3}{3} - 4 \frac{x^2}{2} + x \right) \right|_1^2 \\  &= (8 - 8 + 2) - (1 - 2 + 1) \\  &= 2 \end{align*}

Putting all of these pieces together, we have,

    \[ \int_0^2 \left| (x-1)(3x-1) \right| \, dx = \frac{4}{27} + \frac{4}{27} + 2 = \frac{62}{27}. \]

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):