Here's a different route for finding the anti-derivative that doesn't rely on any trigonometric identities at all, save the derivatives of sine and cosine. Simple algebraic manipulation gives $$\int(\cos^2{x}-\sin^2{x})dx=\int(\cos{x}+\sin{x})(\cos{x}-\sin{x})dx.$$
Note that the derivative of $\cos{x}+\sin{x}$ is $\frac{d}{dx}(\sin{x}+\cos{x})=\cos{x}-\sin{x}$, which prompts the substitution $u=\cos{x}+\sin{x}$ in the integral above. Then,
$$\int(\cos^2{x}-\sin^2{x})dx=\int(\cos{x}+\sin{x})(\cos{x}-\sin{x})dx\\
=\int u\,du\\
=\frac12u^2+constant\\
=\frac12(\cos{x}+\sin{x})^2+constant$$
It follows immediately that the integral considered in your question is
$$\int(1+\cos^2{x}-\sin^2{x})dx=x+\frac12(\cos{x}+\sin{x})^2+constant.$$
Appendix: One might wish to verify the anti-derivative $F(x)=x+\frac12(\cos{x}+\sin{x})^2$ found by the method in this answer is consistent with the anti-derivative $G(x)=x+\frac12\sin{(2x)}$ arrived at in responses by other users. If you're suspicious that $F(x)\neq G(x)$, you'd be right. Beginners sometimes get tripped up by this, because they forget anti-derivatives need not be equal (all those times your high-school calculus teacher nagged on you to remember that pesky "+ constant", she really wasn't just being an insufferable pedant!). Indeed,
$$(\cos{x}+\sin{x})^2=\cos^2{x}+\sin^2{x}+2\cos{x}\sin{x}=1+\sin{(2x)}\\
\implies \frac12(\cos{x}+\sin{x})^2 - \frac12\sin{(2x)} = \frac12.$$
Since $F$ and $G$ only differ by a constant, they are consistent.