Maximum value of the product of probabilities I came across a confusing probability problem. It reads as follows:

Let $S$ be a sample space and two mutually exclusive events $A$ and $B$ be such that $A \cup B = S$. If $P(\cdot)$ denotes the probability of the event, what is the maximum of $P(A)P(B)$?

There are two explanations for the solution to the problem:
Solution 1
$P(A) + P(B) = 1$, since both are mutually exclusive and $A ∪ B = S$. 
When sum is a constant, product of two numbers becomes maximum when they are equal. So, $P(A) = P(B) = 1/2$. 
Thus, $1/2 \cdot 1/2 =1/4$
Solution 2
$P(A) + P(B) = 1$, since both are mutually exclusive and $A ∪ B = S$. 
Let $P(A) = x$
Thus, $P(B)=(1-x)$
Let $f(x) = P(A)P(B) = x(1-x)$
$f'(x) = 1-2x$ 
$f'(x)=0$ implies $x=\frac{1}{2}$
$f''(x)=-2<0$  at  $x=\frac{1}{2}$
$\therefore f(x)$ is maximum at $x = \frac{1}{2}$
$\therefore$ Maximum value of $P(A)\cdot P(B) = x(1-x) = \frac{1}{2}(1-\frac{1}{2}) = 0.25$
Solution 1 is quiet understandable, but what I did not understood is the logic behind whole derivative part of the solution 2.
 A: 
Solution 1 is quiet understandable, but what I did not understood is the logic behind whole derivative part of the solution 2.

The derivative of a curve at a point is equal to the gradient of the tangent at that point.   That is, it represents the slope of the curve; which is the rate of change.
Now, the gradient of the tangent at the maxiumum of a curve is zero.   The curve is neither rising nor falling at the maximum; so the slope of the tangent is zero.   Note: it is also zero at the minimum and at a point of inflection.  (The points where the first derivative is zero are called "critical points".)
Thus a way to find a maxima, minima, or point of inflection of a curve is to solve for the independent variable when the derivative equals zero, then check which of the three types are the critical points you have found. 


*

*If you have $y=f(x)$ and wish to find the maxima, find all values of $x$ that solve for $\frac{\mathrm d f(x)}{\mathrm d x} = 0$; and check to see if they are a (local) maxima by comparing with sufficiently close neighbours.

*The curve has to be continuous and derivable to use this method, obviously.


Another way to test the critical points is to take the second derivative, which measures the "rate of change of the rate of change".   This will be less than zero at a maxima, greater than zero at a minima, and zero at an inflection.

I am not able to link the derivative to the probabilities. I never used derivatives in probability course yet. So can you please explain me more?

You will use derivation and integration in later probability studies.  Be prepared.
However, in this case the link is just that you are seeking a maxima, and this is a method to find the maxima of a function.   It's not about probabilities per se.
We chose the function $f(x)=x(1-x)$ because we are looking for the maximum value of $\mathsf P(A)\big(1-\mathsf P(A)\big)$.
This is a continuous function over the interval $x\in[0;1]$.   It is also derivable, and the derivative is $f'(x) = 1-2x$.   We let $1-2x=0$ and solve to find: $x=1/2$.   Since $f(1/2) = 1/4, f(0)=0, f(1)=0$, then it is clear this is the local maxima in the interval (the ends of the interval are sufficiently close).
We can also take the second derivative, $f''(x) = -2$ which immediately tells us any critical points we do find will be maxima.
A: By second derivative test,
Let $f(x)$ be a function.Let $f'(x)$and $f''(x)$ be its first and second derivatives respectively.
Then solve $f'(x)=0$ and find the critical points.Let us say $x_1,x_2,x_3$ are the critical points.Now evaluate $f''(x)$ at every critical point.
If $f''(x_1)<0$,then $x_1$ is the point of maxima and $f(x_1)$ is the local maximum value of the function.
If $f''(x_2)>0$,then $x_2$ is the point of minima and $f(x_2)$ is the local minimum value of the function. 
If $f''(x_3)=0$,then $x_3$ is the point of inflexion and second derivative test fails and look for third derivative test.
