Let Y=KX+B, then 25K+B=2000, 24K+B=2500, the solution is k =-500, b = 14500, and the functional relationship is Y=-500X+ 14500.
p =(X- 13)* Y =(X- 13)(-500 X+ 14500)=-500 x2+2 1000 X- 188500 =-500(X-2 1)2+32000
The functional relationship between p and x is p =-500x2+21000x-188500.
When the price is 2 1 yuan/kg, the maximum profit can be obtained, which is 188500 yuan.