What is the sign convention being used in thermodynamics for calculating work done? I am currently studying from Daniel V. Schroeder's An Introduction to Thermal Physics. I think there is some discrepancy the way he goes from equation 1.28 to equation 1.29. I get the calculus, but I am not following his reasoning.
In 1.28 he mentions that negative sign is being used because the volume is decreasing (and the work is being done on the system). But then in 1.29 he uses the same negative signed formula for a system that is clearly expanding (and hence work is being done by the system) as that can be seen from the graph and the limits used in the integration. 
I know this is all about sign convention but I think he is not being consistent here. 



 A: First law of thermodynamics is a work-energy balance equation. If we state it loud, it would sound like this:
“All $\mathrm{δ}Q$ amount of heat that we add to a system and do not end up to be used to perform a $\mathrm{δ}W$ amount of work, will be stored in that system as a $\mathrm{d}U$ increase in its internal energy”. Writing this down mathematically
$$δQ=dU+δW \tag{1}$$
This equation is always true independently of the sign convention for the thermodynamic work. Rearranging (1)
$$dU= δQ –δW= δQ +(–δW) \tag{2}$$
In mechanics, work as been defined as
$$dW \equiv F \cdot \mathbf{d}x \tag{3}$$
Considering that
$$p=\frac{F}{A} \Longrightarrow F=pA \tag{4}$$
Substituting (4) in (3), taking into account that $\mathrm{d}V=A \mathrm{d}x$
$$dW=p \mathrm{d}V \tag{5}$$
From the 2 equalities in (2) we realize that work in thermodynamics can be defined in 2 ways without violating the statement of first law:
$$\begin{equation}
\begin{cases}
dW_T = dW=p \mathrm{d}V & \, (Work) \\
dU= δQ–δW_T  & \, (First \, law)
\end{cases}
\tag{Option 1}
\end{equation}$$
Or
$$\begin{equation}
\begin{cases}
dW_T = –dW=-p \mathrm{d}V & \, (Work) \\
dU= δQ +δW_T  & \, (First \, law)
\end{cases}
\tag{Option 2}
\end{equation}$$
In option 1) expansion work (work done by the system) is positive since $V_2 >V_1, δW >0$ and compression work (work done into the system) is negative. The reverse happens in option 2).
Option 1) is the so called Clausius notation and has the advantage of giving a direct relation between mechanical and thermodynamic work. Option 2) is the new notation proposed by IUPAC, and has the advantage of depicting all net energy going out of the system as negative, just like in any balance sheet.
There is nothing wrong with any of the 2 choices, as long as you keep it the same throughout you book or paper.
A: The author is playing it "fast and loose" with the mathematics.  In this analysis, $\Delta x$ is supposed to be the movement of the piston inward   toward the gas.  So the change in volume of the gas is $\Delta V=-A\Delta x$. It's a silly way of doing it.  
Eqns. 28 and 29 correctly represent the work done by the piston on the gas.
A: Well, I think I got the answer to my own question to which I am answering myself here.

Given: First Law of Thermodynamics as
$$\Delta U = Q + W$$
Where,
$U$ = Total internal energy of the system.
$Q$ = Heat Supplied
$W$ = Could be work done ON or BY the system.
Assumption (/Sign Convention):

*

*During COMPRESSION, the internal energy of the system increases, so $W$ is taken as POSITIVE here because it helps in increasing the total internal energy of the system. This is called as work done ON the system.
Since volume decreases in this process, the change in volume is taken as NEGATIVE.


*During EXPANSION, the internal energy of the system decreases, so $W$ is taken as NEGATIVE here because the system spends its energy in pushing the piston outward. This is called as work done BY the system.
Since volume increases in this process, the change in volume is taken as POSITIVE.
Application:
1. In COMPRESSION (/work done ON the system):
$+W$ = (Pressure)$*$($-$Change in Volume)
So, $W$ = $-$(Pressure)$*$(Change in Volume)
$W = -P*\Delta V ----1.28$
2. In EXPANSION (/work done BY the system):
$-W $= (Pressure)$*$($+$Change in Volume)
So, $ W$ = $-$(Pressure)$*$(Change in Volume)
$W= - P* \Delta V ----1.29$
Equations 1.28 & 1.29 give formula for the work done in respective cases.

I think this is the correct explanation. The book does so too but it is kind of not clear of the process.
Thank you to all who responded.
A: For the compression process the change in volume is negative as we know. So ∆V is negative. Hence work done is also negative.
But for expansion ∆V is positive but work is being done by the system. According to modern sign convention work done by the system is negative. Hence it is also negative for  expansion process.
