Quantum oscillator transition amplitude I have a quick question regarding an equation in my textbook. It's about calculating the probability transition amplitude of a quantum oscillator.

Why is this true? The difference between the first and the second row seems to be small. There is a minus sign before $\dfrac{i}{\hbar}$. In the top row there is a term with a plus sign and a term with a minus sign. Doesn't that mean that on the bottom row they should be minus and plus respectively. Why are they both positive?
I thought there is a mistake in the book but I found a similar derivation in other books, so I guess I am missing something.
Thank you!
 A: The integral we want to simplify is the following
$\int_0^t dt'\frac{m}{2}(\dot{r}^2(t') - \omega^2r^2(t')) $
The second part is fine and doesn't need any work, so we will work with the first term.
$$
\begin{eqnarray*}
\frac{m}{2}\int_0^t dt'\dot{r}^2(t') &=& \frac{m}{2}\int_0^t dt' \partial_{t'}r(t') \cdot \partial_{t'}r(t') \\
\end{eqnarray*}
$$
Now we let $$\partial_tr \partial_tr = \partial_t (r \partial_t r) - r \partial^2_t r $$
This makes the above integral equal to
$$\frac{m}{2}\int_0^t dt' \partial_{t'}r(t') \cdot \partial_{t'}r(t') =
\left.r\partial_{t'} r\right|^t_0 -\frac{m}{2}\int_0^t dt'r \partial^2_{t'} r$$
Typically in path integral formulation, the endpoints of the first integral cause the evaluation to be zero as the path ends and begins exactly at the points (no variation). So we are left with
$$-\frac{m}{2}\int_0^t dt'r \partial^2_{t'} r$$
Combining this with your original integral yields
$$\int_0^t dt' \frac{m}{2}(-r\partial^2_{t'} r - \omega^2 r^2(t')) $$
We then pull out an r to the right and left, plus the negative sign to obtain
$$ -\int_0^t dt' \frac{m}{2}r(t')(\partial^2_{t'}  + \omega^2) r(t')$$
A: 

The notation is slightly different.
