Help explaining the simplification of an integral I am trying to understand the following steps my teacher did in class (from top to bottom). I tried to look up different trigonometric identities but couldn't figure out where the arrival of cosine squared came from, and the other sine values arrived to the right of the plus sign. 
Thanks! 

$$ \begin{align}
\pi &= \frac 1 T \int_0^t F \cos \omega t \frac{F}{|{\underline{z}_m}|} \cos(\omega t - \theta) \ dt \\
&= \frac{F^2}{T |\underline{z}_m|} \int_0^t \left[
\cos^2 \omega t \cos \theta + \cos \omega t \sin \omega t \sin \theta
\right] \ dt
\end{align}$$

 A: Assuming that $F$ and $\left| z_m \right|$ are constants, they can come all the way outside the integral. 
This leaves you with: 
$$
\cos (\omega t) \cos (\omega t - \theta)
$$
as the integrand.
Note the trig identity:
$$ 
    \cos(a - b) = \cos(a) \cos(b) + \sin(a) * \sin(b)
$$
substituting 
$$
    a = \omega t   \qquad and \qquad   b = \theta, 
$$
it follows
$$
    \cos(\omega t - \theta) = \cos(\omega t) \cos(\theta) + \sin(\omega t) \sin(\theta)
$$
From this, it follows:
$$
\cos(\omega t)\cos(\omega t - \theta) = \cos^2(\omega t) \cos(\theta) + \cos(\omega t) \sin(\omega t) \sin(\theta)
$$
which is the integrand on your second line.
A: Hint: The cosine angle subtraction identity says that $\cos(a-b)=\cos a\cos b+\sin a\sin  b$ for all $a,b$. What does this tell you for $a=\omega t$, $b=\theta$? Further, $F$ and $z_m$ are (presumably) constant with respect to $t$, so they can be brought out of the integral sign. Can you proceed?
A: Knowing the sum and difference trig cosine formulas would help:
$$\cos(a\pm b)=\cos(a)\cos(b)\mp\sin(a)\sin(b)$$
This applies here with $\begin{bmatrix} a \\ b\end{bmatrix}=\begin{bmatrix} \omega t \\ \theta\end{bmatrix}$. Plugging this information into the integrand in your statement gives you the required result.
