What is the sign of the work done on the system and by the system? What is the sign of the work done on the system and by the system?
My chemistry book says when work is done on the system, it is positive. When work is done by the system, it is negative.
My physics book says the opposite. It says that when work is done on the system, it is negative. When work is done by the system, it is positive.
Why do they differ?
 A: Taking it in a different sense: chemistry is taken the approach that you want to create a new configuration inside the reaction vessel (and input energy like heat or such) and the physics course book is taking about letting the system doing work (eg. burning what is in the reaction vessel). 
In both ways entropy will be at least equal or positive.     
A: It's just a convention in physics we are more interested in getting some work output say a mechanical device , engine etc while in chemistry we are more concerned with the internal energy things so we do so in both the cases the result is same 
physics case : du = dq - dw , doing work on system increases internal energy as dw = negative for work done on system and vice versa 
chemistry case : du = dq + dw ; doing work on system will increase the internal energy of the system as dw = positive which is obvious and vice versa.
we can take any sign convention in a given problem but we should be consistent with that throughout the problem to avoid confusion and mistake.
A: It is just a matter of convention. It should be consistent throughout. 
Case 1: Work done on the system is positive.
Here the first law is written as 
$$ \mathrm{d}U = \mathrm{d}Q + \mathrm{d}W  \,.\tag{1}$$
If your frame of reference is "system", then the work done on the system ($W$) is positive and the heat that is added to the system is also positive, which means the change in internal energy is also positive by first law of thermodynamics, which means that there is an increase in temperature. This appeals to common sense. Here positive change in internal energy corresponds to increase in temperature
Case 2: Work done by the system is positive
Here the first law is written as 
$$ \mathrm{d}U = \mathrm{d}Q - \mathrm{d}W  \,. \tag{2}$$
If work is applied to the system, $\mathrm{d}W$ term becomes negative making two negatives positive, which is identical to equation (1) and heat added to the system is still positive here. Rest of the arguments follow as above.
