How to integrate the product of two or more polynomials raised to some powers, not necessarily integral This question is inspired by my own answer to a question which I tried to answer and got stuck at one point. 

The question was:

HI DARLING.
USE MY ATM CARD, TAKE ANY AMOUNT OUT, GO SHOPPING AND TAKE YOUR FRIENDS FOR LUNCH.
PIN CODE: $\displaystyle \int_{0}^{1} \frac{3x^3 - x^2 + 2x - 4}{\sqrt{x^2 - 3x + 2}} \, dx $
I LOVE YOU HONEY.
Anyone knows? Are we gonna get an integer number?


My attempt:
Does this help?

$$\frac{3x^3-x^2+2x-4}{x-1}=3x^2+2x+4$$
  (long division)
  \begin{align*}
I&=\int\frac{3x^3-x^2+2x-4}{[(x-1)(x-2)]^{1/2}} dx = \\
&=\int\frac{(3x^2+2x+4)(x-1)^{1/2}}{(x-2)^{1/2}} dx = \\
&=\int 3(u^4-4u^2-4)(u^2+1)^{1/2}du \times 2
\end{align*}
  after the substitution
  \begin{gather*}
(x-2)^{1/2}=u\\
du=\frac1{2(x-2)^{1/2}}dx\\
u^2=x-2\\
(x-1)^{1/2}=(u^2+1)^{1/2}
\end{gather*}

Update: This may help us proceed.

I tried to proceed:

$$6\int (u^4-4u^2-4)(u^2+1)^{1/2} du = 6\int ((t-3)^2-8)t \frac{dt}{2u}$$
  after $u^2+1=t$ and $dt=2udu$
  \begin{align*}
u^4-4u^2-4
&= (u^2+1)^2-(6u^2+5) \\
&= (u^2+1)^2-6(u^2+1)+1 \\
&= ((u^2+1)-3)^2-8
\end{align*}

I wonder whether this question can be solved from here?

Update: 
This has been getting a lot of views, and I think most people came for the sort of problem mentioned in the title (where I got stuck) rather than the original problem itself.
Keepin this in mind, I'm reopening the question and here's the kind of answers I expect — Solutions to the original problem are good, but I'd prefer solutions that continue from the part where I got stuck — the polynomial in $u$ — that's the sort of problem mentioned in the title.

Noticing that
$3 x^3-x^2+2 x-4=-(1-x)\left(3 x^2+2 x+4\right)$ and $x^2-3 x+2=(1-x)(2-x)$,
we transform the integral into
$$
I=-\int_0^1 \sqrt{\frac{1-x}{2-x}}\left(3 x^2+2 x+4\right) d x
$$
Let $t^2=\frac{1-x}{2-x}$, then $x=\frac{2 t^2-1}{t^2-1}$ and $d x=-\frac{2 t}{\left(t^2-1\right)^2} d t$, which changes the integral into
$$
I=-2 \int_0^{\frac{1}{\sqrt{2}}} \frac{t^2\left(20 t^4-26 t^2+9\right)}{\left(t^2-1\right)^4} d t
$$
Resolving the integrand into partial fractions as
$$ \frac{t^2\left(20 t^4-26 t^2+9\right)}{\left(t^2-1\right)^4} = {-\frac{135}{32} \cdot \frac{1}{t+1}+\frac{185}{32} \cdot \frac{1}{(t+1)^2}-\frac{7}{4} \cdot \frac{1}{(t+1)^3}+\frac{3}{16} \cdot \frac{1}{(t+1)^4}}+\frac{135}{32} \cdot \frac{1}{t-1}+\frac{185}{32} \cdot \frac{1}{(t-1)^2}+\frac{7}{4} \cdot \frac{1}{(t-1)^3}+\frac{3}{16}\cdot \frac{1}{(t-1)^4}$$
Integrating it from $0$ to $\frac{1}{\sqrt 2} $ yields
$$
\begin{aligned}
I=&-2 \left[-\frac{135}{32} \ln |t+1|-\frac{185}{32(t+1)}+\frac{7}{8(t+1)^2}-\frac{1}{16(t+1)^3} +\frac{135}{32} \ln |t-1|\right.\\ &\left.-\frac{185}{32(t-1)}-\frac{7}{8(t-1)^2}-\frac{1}{16(t-1)^3}\right]_0^{\frac{1}{\sqrt{2}}}\\=& \frac{135}{16} \ln (3+2 \sqrt{2})-\frac{101 \sqrt{2}}{8}
\end{aligned}
$$
