Show that \(\tan ^ { 2 } x + \cos ^ { 2 } x \equiv \sec ^ { 2 } x + \frac { 1 } { 2 } \cos 2 x - \frac { 1 } { 2 }\) and hence find the exact value of
$$\int _ { 0 } ^ { \frac { 1 } { 4 } \pi } \left( \tan ^ { 2 } x + \cos ^ { 2 } x \right) d x$$
\includegraphics[max width=\textwidth, alt={}, center]{48ab71ff-c37b-4e0b-b031-d99b0cf517a8-3_550_785_1573_721}
The region enclosed by the curve \(y = \tan x + \cos x\) and the lines \(x = 0 , x = \frac { 1 } { 4 } \pi\) and \(y = 0\) is shown in the diagram. Find the exact volume of the solid produced when this region is rotated completely about the \(x\)-axis.