<s>[INST] find minimum of maximum of two functions 
I need to find the angle $\theta$ so that: $$\max(\cos^2(\theta),1-\cos^2(45-\theta))$$ is minimized. 

OK, so I wrote \begin{align*}f(\theta)&=\max(\cos^2(\theta),1-\cos^2(45-\theta))\\
&=\frac{\cos^2(\theta)+1-\cos^2(45-\theta)+|\cos^2(\theta)-1+\cos^2(45-\theta)|}{2}\end{align*}
Then I'm stuck.
 [/INST] Prove that $\cos (A + B)\cos (A - B) = {\cos ^2}A - {\sin ^2}B$
$$D=\cos^2t-(1-\cos^2(45^\circ-t))=\cos^2t-\sin^2(45^\circ-t)=\cos(45^\circ)\cos(2t-45^\circ)$$
Case $\#1:$
$\cos^2t$ will be maximum if $D\ge0$ if $\cos(2t-45^\circ)\ge0$
$\iff360^\circ n-90^\circ\le2t-45^\circ\le360^\circ n+90^\circ$
$\iff360^\circ n-45^\circ\le2t\le360^\circ n+135^\circ$
Now in the above range $\cos^2t=\dfrac{1+\cos2t}2$ will be minimum $\iff$ if $\cos2t$ is minimum
which happens if $2t=360^\circ n+135^\circ$
Case $\#2:$
Check when $$1-\cos^2(45^\circ-t)=\sin^2(45^\circ-t)$$ will be maximum
</s>