The work done on an object by an external force is given by the formula
work _{done} = force displacement
Work is our first example of a scalar product or dot product. A dot product occurs when two vectors are multiplied together in such a way as to produce a scalar value. Technically, the above definition for work can be calculated with the equation
work_{done} = F * s cos(θ)
where

F represents the magnitude or the length of vector F

s represents the magnitude or the length of vector s

θ represents the magnitude of the angle between F and s.
Or, it can equivalently be evaluated with the formula
work_{done} = F_{x} * s_{x} + F_{y} * s_{y}
where the x and ycomponents of F and s are multiplied and then added together.
Let's use an example to show how these two expressions are equivalent.
Suppose a toy cart is sliding between two rails along the surface of a table while being pulled diagonally by a force F.
To determine the work done on the cart by the force, we can use either of these two methods: 
work_{done} = F * s cos(θ)

work_{done} = F_{x} * s_{x} + F_{y} * s_{y}
Method #1: work_{done} = F * s cos(θ)
F = 10 N s = 2 m
θ = 37º +  23º  = 60º
work_{done} = F * s cos(θ) = (10)(2) cos (60º) = 10 J
Notice that this result could alternatively be calculated with the expression:
work_{done} = [F cos(θ)] s = [10 cos(60º)](2) = 10 J
where F cos(θ) is the component of F in the direction of s.
Method #2: work_{done} = F_{x} * s_{x} + F_{y} * s_{y}
F_{x} = F cos(α)
= 10 cos(37º) = 8 N
F_{y} = F sin(α) = 10 sin(37º) = 6 N s_{x} = s cos(β)
= 2 cos(23º) = 1.84 m
s_{y} = s sin(β)
= 2 sin(23º) = 0.781 m
work_{done} = F_{x} * s_{x} + F_{y} * s_{y} = (8)(1.84) + (6)(0.781) = 10 J
Any slight numerical differences between the two calculations would be the result of rounding decimal expressions. 
The formula that is usually used to calculate the amount of work done on a mass M by a constant force F acting at an angle θ to its displacement s is W = Fs cos(θ)
Using this formula when θ = 90^{o} the work_{done} = 0 since cos(90^{o}) = 0. Referring to the above diagram, the vertical component, F sin(θ), of F would not result in any work being done on mass M since it acts at right angles to the displacement s.
Work done on an object by a force acting parallel to its displacement can be expressed as simply (where θ = 0º)
work_{done} = Fs
Work can also be calculated as
W_{done} = ∫F ds
or the equivalent area under a force vs displacement graph.
