Answer:
25 days
Step-by-step explanation:
Assuming that the farmer waits for n days to get get the maximum profit.
Given that the total number of cows the farmer has, = 100
Currect weight of one cow = 125 kg.
Weight gain rate for one cow = 3 kg/day
So, weight gained by one cow in n days = 3n kg
Therefore, the weight of one cow after n days 
Cost for keeping one cow = $5/day.
Cost for keeping one cow for n days = $ 5n
So, Cost for keeping 100 cows for n days 
Current market price = 25 pesos / kg = 125 cents / kg [ as 1 peso = 5 cents]
The falling rate of market price = 1 cent /day.
Fall in price in n days
cents.
So, market price after n days 
By using equations (i) and (iii),
The selling price of one cow after n days
cents.
So, the selling price of 100 cows after n days
cents.
As 1 $ = 100 cents. so
The selling price of 100 cows after n days
.
Now, from equations (ii) and (iv)
Net profit, 
To get the maximum profit, differentiate the profit function in equation (v) with respect to n and equate it to zero to get the value of n, i.e
![\frac {dP}{dn}=0 \\\\\Rightarrow \frac {d}{dn}(5(125+3n) (125-n) - 500n)=0 \\\\\Rightarrow 5[ (125+3n)(-1)+(125-n)(3)]-500=0 \\\\\Rightarrow 5[ -125-3n+375-3n]-500 =0 \\\\\Rightarrow 5[ -125-3n+375-3n]=500\\\\\Rightarrow 250-6n=500/5=100 \\\\\Rightarrow 6n = 250-100=150 \\\\\Rightarrow n= 150/6 = 25.](https://tex.z-dn.net/?f=%5Cfrac%20%7BdP%7D%7Bdn%7D%3D0%20%5C%5C%5C%5C%5CRightarrow%20%5Cfrac%20%7Bd%7D%7Bdn%7D%285%28125%2B3n%29%20%28125-n%29%20-%20500n%29%3D0%20%5C%5C%5C%5C%5CRightarrow%20%205%5B%20%28125%2B3n%29%28-1%29%2B%28125-n%29%283%29%5D-500%3D0%20%5C%5C%5C%5C%5CRightarrow%205%5B%20-125-3n%2B375-3n%5D-500%20%3D0%20%5C%5C%5C%5C%5CRightarrow%205%5B%20-125-3n%2B375-3n%5D%3D500%5C%5C%5C%5C%5CRightarrow%20250-6n%3D500%2F5%3D100%20%5C%5C%5C%5C%5CRightarrow%206n%20%3D%20250-100%3D150%20%5C%5C%5C%5C%5CRightarrow%20n%3D%20150%2F6%20%3D%2025.)
Hence, the farmer has to wait for 25 days to get the maximum profit.