Integration by parts with complicated expression In my quantum text (don't worry, there's no physics in this question), as part of a proof it states that the integral
$$\int \left[f^* \frac{\partial^3 f}{\partial x^3} - \frac{\partial^2 f^*}{\partial x^2}\frac{\partial f}{\partial x}\right]\ dx$$
"integrates to zero, using integration by parts twice".  Here $f = f(x,t)$.  I haven't been able to confirm this.  First off, for integration by parts you need a product, but I don't even see a product here.  Except $f^* \frac{\partial^3 f}{\partial x^3} - \frac{\partial^2 f^*}{\partial x^2}\frac{\partial f}{\partial x}$ times $1$.  So I try that:
$$u = f^* \frac{\partial^3 f}{\partial x^3} - \frac{\partial^2 f^*}{\partial x^2}\frac{\partial f}{\partial x} \implies du = \left[\frac{\partial f^*}{\partial x} \frac{\partial^3 f}{\partial x^3} + f^*\frac{\partial^4 f}{\partial x^4}- \frac{\partial^3 f^*}{\partial x^3}\frac{\partial f}{\partial x}-\frac{\partial^2 f^*}{\partial x^2}\frac{\partial^2 f}{\partial x^2}\right]dx \\ dv = dx \implies v = x$$
So then 
$$\int f^* \frac{\partial^3 f}{\partial x^3} - \frac{\partial^2 f^*}{\partial x^2}\frac{\partial f}{\partial x}\ dx \\ = \left[f^* \frac{\partial^3 f}{\partial x^3} - \frac{\partial^2 f^*}{\partial x^2}\frac{\partial f}{\partial x}\right]x - \int x \left[\frac{\partial f^*}{\partial x} \frac{\partial^3 f}{\partial x^3} + f^*\frac{\partial^4 f}{\partial x^4}- \frac{\partial^3 f^*}{\partial x^3}\frac{\partial f}{\partial x}-\frac{\partial^2 f^*}{\partial x^2}\frac{\partial^2 f}{\partial x^2}\right]dx \\ = \left[f^* \frac{\partial^3 f}{\partial x^3} - \frac{\partial^2 f^*}{\partial x^2}\frac{\partial f}{\partial x}\right]x - \int x \left[\operatorname{Im}\left(\frac{\partial f^*}{\partial x} \frac{\partial^3 f}{\partial x^3}\right) + f^*\frac{\partial^4 f}{\partial x^4}-\left|\frac{\partial^2 f}{\partial x^2}\right|^2\right]dx$$
And I'm already swamped by this.  I still don't see a product so I guess for the second IBP I'd just take the whole integrand to be $u$ again and but then I'm just going to end up with even higher derivatives of $f$.  Can anyone explain how to go about proving that the above integral (over the whole region where $f$ is defined incidently) vanishes?
 A: Integrate by parts on the product
$$\int_B dx \,f^* \frac{\partial^3 f}{\partial x^3} = \left [f^* \frac{\partial^2 f}{\partial x^2} \right ]_{\partial B} - \int_B dx \, \frac{\partial f^*}{\partial x} \frac{\partial^2 f}{\partial x^2} $$
where $B$ the region of integration over $x$.  Now integrate by parts on the integral on the right; the result is
$$\int_B dx \,f^* \frac{\partial^3 f}{\partial x^3} = \left [f^* \frac{\partial^2 f}{\partial x^2} - \frac{\partial f^*}{\partial x} \frac{\partial f}{\partial x} \right ]_{\partial B} + \int_B dx \, \frac{\partial^2 f^*}{\partial x^2} \frac{\partial f}{\partial x} $$
or
$$\int_B dx \, \left ( f^* \frac{\partial^3 f}{\partial x^3} - \frac{\partial^2 f^*}{\partial x^2} \frac{\partial f}{\partial x} \right ) = \left [f^* \frac{\partial^2 f}{\partial x^2} - \frac{\partial f^*}{\partial x} \frac{\partial f}{\partial x} \right ]_{\partial B} $$
If the RHS is zero, then the LHS is zero.
A: Break your integral up into two:
$$
\int f \frac{\partial^3 f}{\partial x^3}dx - \int \frac{\partial f}{\partial x} \frac{\partial^2 f}{\partial x^2}dx
$$
Now in the first integral, you differentiate f and integrate the third derivative, you will have one first and one second derivative, right? just like the second integral, but with a negative sign (so, effectively, twice the second integral, they haven't canceled yet!) Then go by parts again, integrate the second derivative and differentiate the first, so you have again the second integral but now with a positive sign, and it all cancels (so long as, like you say, boundary terms are gone).
Details if you need them, this is working on the first integral:
$$
\int (f )  (f^{(3)}) dx=[bdry terms] - \int (f')(f'')=[bdry terms]+[morebdry terms]+\int (f'')(f')
$$
which is exactly the negative of the second integral
