You have the following function:

Derivate implictly the previous expression, as follow:

Where you have used that:

Then, the implicit derivative of the given expression is:

Next, solve for y' as follow:

Answer:
1. Number of boys in A is 52028.
2. Number of girls in B is 46510.
3. Town B has more number of girls.
Step-by-step explanation:
1. 
2. 
3.
(A < B)
I was to tired to write it down