It is given that A and B are mutually exclusive.
Also, it is given that A∪B=S
This means A and B are collectively exhaustive.
Now if A and B are both mutually exhaustive and collectively exhaustive, then
P(A)+P(B)=1⇒P(B)=1−P(A)
Let P(A)=x and y=P(A)P(B)
Then y=x−x2
dydx=1−2x=0⇒x=12d2ydx2∣∣∣x = 1/2=−2<0
Therefore, maximum value of y will occur at x=12
and ymax=12−(12)2=0.25