Work is defined as:
[tex]W = \int\limits {\overrightarrow F \cdot} \, \overrightarrow {ds} = \int\limits {F cos \theta} \, ds [/tex]
where F is the applied force, ds is the incremental displacement and θ is the angle between the force and the displacement.
If the force F is constant the equation simplifies to:
[tex]W = (Fs) cos\theta[/tex]
In your example:
[tex]W = (25N)(50m)(cos 40 \textdegree) = 957,6 J = 9.6 \times 10^2J[/tex]