Let 'y' be the total contribution that has to be maximised and 'x' be the selling price . now set the following equation:
y= [10000-(x-25)X500/0.5](x-17)
y=52000x-595000-1000x2
then dy/dx=52000-2000x and d2y/dx2=-2000
setting dy/dx=0 we get 52000-2000x=0 or x=26 hence the selling price is Rs.26. the quantity sold is 9000units.