Why $\cos^3 x - 2 \cos (x) \sin^2(x) = {1\over4}(\cos(x) + 3\cos(3x))$? Wolfram Alpha says so, but step-by-step shown skips that step, and I couldn't find the relation that was used.

Here's a detailed step by step:
$=\frac{1}{4}(\cos(x)+3\cos(3x))$
$=\frac{1}{4}(\cos(x)+3\cos(x+2x))$
$=\frac{1}{4}(\cos(x)+3[\cos(x)\cos(2x)-\sin(x)\sin(2x)])$
$=\frac{1}{4}(\cos(x)+3[\cos(x)(1-2\sin^2(x))-\sin(x)(2\sin(x)\cos(x))])$
$=\frac{1}{4}(\cos(x)+3[\cos(x)-2\cos(x)\sin^2(x))-2\sin^2(x)\cos(x)])$
$=\frac{1}{4}(\cos(x)+3[\cos(x)-4\cos(x)\sin^2(x))])$
$=\frac{1}{4}(\cos(x)+3\cos(x)-12\cos(x)\sin^2(x))$
$=\frac{1}{4}(4\cos(x)-12\cos(x)\sin^2(x))$
$=\cos(x)-3\cos(x)\sin^2(x))$
$=\cos(x)-\cos(x)\sin^2(x)-2\cos(x)\sin^2(x)$
$=\cos(x)(1-\sin^2(x))-2\cos(x)\sin^2(x)$
$=\cos^3(x)-2\cos(x)\sin^2(x)$
If your question is an assignment, please try to resolve it from scratch without looking at the answer. There are other ways to solve it. Also try that for practice.
