Animate object along path and deform accordingly
Curve Modifier

As stated in the Blender reference manual about the modifier:


  The Curve Modifier provides a simple but efficient method of deforming
  a mesh along a curve object.


If you are working with a single object, make sure to fill the Deformation Axis field of the modifier with the correct value (X in my case, the object has no trasfomation) and to give your deformed object and path enough subdivions:



Then, you just have to animate the position of your object along the picked axis (X in this case) and optionally the rotation along the same axis to match the motion of the pencil shown in your example.

In my test file a took advantage of the keyframe modifier called Generator to set up a linear function for both: