I am trying to understand that why does a piston engine produce vibrations? What is the source of it and how will it cause the whole internal combustion engine to vibrate in response? Will jet engines or turboprop also produce vibrations? If yes, then is the reason the same as piston engines?
The common denominator in ICE and jet engines is probably imbalances of rotating masses.
ICE's have additional vibrations which are due to the firing of the different cylinders. The firing itself is a source of vibration. Depending on the condition of the engine and the fuel, the vibrations can intensify.
As additional source of vibration is the torque variation within a cycle.
Figure: Typical torque behavior of a single-cylinder ICE as a function of the shaft angular position during two revolutions (source: Gianluca Brando)
This variation however is less evident as the number of cylinders increases.
A source of vibrations only present in jet engines, is the dirt and contaminants from the atmosphere.
From out-of-balance forces, caused by rotating and / or reciprocating masses.
Lots of published theory about this.
A quick google search gave the following:
There are so many sources that you can find, explaining from either the real world of doing it or the theoretical world of resolving all the forces - often studied in engineering degrees - definitely in mine (won't be looking for my notes though :) )
Other things you can check out on ICE are Dual Mas flywheels and balance shafts (often contra-rotating).
I want to add to answers an obvius but commonly overloked source of vibration, compressed air vibration.
Air as it moves through engine gets compressed violantly and then goes through ignition and expansion till it exits the cylinder through exhust manifold and catalic converter.
it vibrates so intensly that it can potentially bust the exhust canister in an explosion.
In jets the air going through the compressor and ingnition turbine accelerates and vibrates like an air insteument and in correct lighting one can see the vivid glow of exhast stream's standing wave.