I am trying to understand the derivation of Bernoulli's principle by using the conservation of energy. This is the sketch I will be referring to. I am stuck in understanding a seemingly basic step in finding the total work done by the fluid without gravitational work. The fluid is flowing to the right, the two forces that are doing work are $p_1A_1$ and $p_2A_2$, and the two works are equal to $W_1=p_1A_1s_1$ and $W_2=p_2A_2s_2$. Now this is the part I do not understand. The total work done is $$W_1-W_2=(p_1-p_2)\Delta V.$$ Why is that when both forces act in the same direction? If we are finding the difference in work done (increase in energy) wouldn't it be $$W_2-W_1=(p_2-p_1)\Delta V~?$$ However if I go this way my signs at the end don't match up with according dynamical and hydrostatical pressures.
Ideal fluids are, by definitions, continuous bodies which support only compressive stresses. It means that a portion of fluid, say, a volume with regular boundary, is such that every small area of its boundary receives a surface force (proportional to the area) from the external part of fluid, and this force is always directed towards the interior of the portion of fluid and is orthogonal to its boundary.
A portion of fluid may move only if the sum of these compressive stresses in not vanishing.
We cannot pull (ideal) fluids, we can only push them!
In your example, you are considering an approximatively cylindrical portion of fluid bounded by two lateral surfaces A1 and A2. The remaining part of the boundary is irrelevant for the computation of the work due to the stresses on this portion of fluid, since these forces are normal to the velocity of the particles of fluid.
As the forces are always compressive, the forces on the lateral surfaces must be directed along opposite directions. Since the fluid moves from the left to the right, the force on A1 must have intensity greater than the one on A2. This difference moves (pushes) the cylinder.