Answer
$-\displaystyle \frac{1}{6}(1-e^{3x-1})|1-e^{3x-1}|+C$
Work Step by Step
In the table "Shortcut RuIe: lntegrals of Expressions Involving $(\mathrm{a}x+b)$", our target is $\displaystyle \int|ax+b|dx =\displaystyle \frac{1}{2a}(ax+b)|ax+b|+C$
Substitute:
$\left[\begin{array}{ll}
u=e^{3x-1}, & du=(e^{3x-1}\cdot 3)dx \\
& e^{3x-1}dx=du/3
\end{array}\right]$
$\displaystyle \int e^{3x-1}|1-e^{3x-1}|dx=\frac{1}{3}\int|1-u|du$
we have our target integral, $a=-1, b=1$
$=\displaystyle \frac{1}{3}(\frac{1}{2(-1)}(1-u)|1-u|)+C$
bring back the variable $x$
= $-\displaystyle \frac{1}{6}(1-e^{3x-1})|1-e^{3x-1}|+C$