Hello Catlover0330,
We are given to verify:
$$1+\cos(x)+\cos(2x)=\frac{1}{2}+ \frac{\sin\left(\frac{5}{2}x \right)}{2 \sin\left(\frac{1}{2}x \right)}$$
Let's begin with the left side of the identity and rewrite it as follows:
$$1+\cos(x)+\cos(2x)=1+3+4\cos(x)+\cos(2x)-3-3\cos(x)$$
Using the identities:
$$8\cos^4(\theta)=3+4\cos(2\theta)+\cos(4\theta)$$
$$6\cos^2(\theta)=3+3\cos(2\theta)$$
We may write:
$$1+\cos(x)+\cos(2x)=1+8\cos^4\left(\frac{1}{2}x \right)-6\cos^2\left(\frac{1}{2}x \right)$$
Factor the right side:
$$1+\cos(x)+\cos(2x)=\left(4\cos^2\left(\frac{1}{2}x \right)-1 \right)\left(2\cos^2\left(\frac{1}{2}x \right)-1 \right)$$
Rewrite the first factor and use the double-angle identity for cosine on the second factor:
$$\cos(2\theta)=2\cos^2(\theta)-1$$
to obtain:
$$1+\cos(x)+\cos(2x)=\left(3-4\left(1-\cos^2\left(\frac{1}{2}x \right) \right) \right)\cos(x)$$
To the first factor on the right, apply the Pythagorean identity:
$$\sin^2(\theta)=1-\cos^2(\theta)$$
to obtain:
$$1+\cos(x)+\cos(2x)=\left(3-4\sin^2\left(\frac{1}{2}x \right) \right)\cos(x)$$
Multiply the right side by:
$$1=\frac{\sin\left(\frac{1}{2}x \right)}{\sin\left(\frac{1}{2}x \right)}$$
to obtain:
$$1+\cos(x)+\cos(2x)=\frac{\left(3\sin\left(\frac{1}{2}x \right)-4\sin^3\left(\frac{1}{2}x \right) \right)\cos(x)}{\sin\left(\frac{1}{2}x \right)}$$
To the first factor in the numerator on the right, apply the triple-angle identity for sine:
$$\sin(3\theta)=3\sin(\theta)-4\sin^3(\theta)$$
to obtain:
$$1+\cos(x)+\cos(2x)=\frac{\sin\left(\frac{3}{2}x \right)\cos(x)}{\sin\left(\frac{1}{2}x \right)}$$
To the numerator on the right, apply the product-to-sum identity:
$$\sin(\alpha)\cos(\beta)=\frac{\sin(\alpha-\beta)+\sin(\alpha+\beta)}{2}$$
to obtain:
$$1+\cos(x)+\cos(2x)=\frac{\sin\left(\frac{1}{2}x \right)+\sin\left(\frac{5}{2}x \right)}{2\sin\left(\frac{1}{2}x \right)}$$
Rewrite the right side using the algebraic property:
$$\frac{a+b}{c}=\frac{a}{c}+\frac{b}{c}$$
to obtain:
$$1+\cos(x)+\cos(2x)=\frac{\sin\left(\frac{1}{2}x \right)}{2\sin\left(\frac{1}{2}x \right)}+\frac{\sin\left(\frac{5}{2}x \right)}{2\sin\left(\frac{1}{2}x \right)}$$
Divide out common factor in numerator and denominator of first term on the right:
$$1+\cos(x)+\cos(2x)=\frac{1}{2}+\frac{\sin\left( \frac{5}{2}x \right)}{2\sin\left(\frac{1}{2}x \right)}$$
Shown as desired.