<s>[INST] Maximize $(1-a)(1-c)+(1-b)(1-d)$ over $a^2+b^2=c^2+d^2=1$. Let $a,b,c,d$ be real numbers such that $a^2+b^2=c^2+d^2=1$. Find the maximum value of $(1-a)(1-c)+(1-b)(1-d)$.

I tried substituting $a=\sin x, b =\cos x, c = \sin y, d=\cos y$, then expanded $(1-a)(1-c)+(1-b)(1-d)$. However this just leads to an ugly expression, and I'm not sure how to proceed
 [/INST] WLOG, Let $a=-\sin2x,c=-\sin2y, b=-\cos2x,d=-\cos2y$
$$S=(1-a)(1-c)+(1-b)(1-d)$$
$$=2+(\sin2x+\sin2y+\cos2x+\cos2y)+\cos2(x-y)$$
$$=1+2\cos(x-y)(\sin(x+y)+\cos(x+y))+2\cos^2(x-y)$$ will be maximum
$(1)$ if $\cos(x-y)$ is maximum and so is $\sin(x+y)+\cos(x+y)$
$\cos(x-y)$ will be maximum $(=1)$ which needs  $x=2n\pi+y$
$\sin(x+y)+\cos(x+y)$ reduces to $\sin2y+\cos2y=\sqrt2\cos\left(2y-\dfrac\pi4\right)$
which is $\le\sqrt2$ the equality occurs if $2y=2m\pi+\dfrac\pi4$
So, $$S\le1+2\cdot1\cdot\sqrt2+2\cdot1$$
$(2)$ or if $\cos(x-y)$ is minimum and $\cos(x+y)+\sin(x+y)$ is minimum i.e., $-\sqrt2$
</s>