what exactly is the gain of an antenna, and what is the difference between the gain and the directivity?
An antenna, such as a yagi, concentrates the available transmit power mostly in one direction. In that direction only, the signal transmitted will be stronger than if it was coming from a dipole in the same position ( and radiating at right angles to the dipole wire). This difference is called the gain of the antenna and is always given as gain over a dipole, in dBd.
In all other directions, the signal will be weaker than it would be from a dipole.
The more gain an antenna has, the more concentrated the radiation pattern is. This is measured by moving a little off to the sides of the main beam of energy and noting the directions where the power is reduced by 3 dB on each side. The angle between these directions is the beamwidth of the antenna, or the directivity.
also, what is the EIRP, is it the same as the radiated power? and how can the radiated power be greater than the transmitted power? (EIRP= transmitted power+gain-losses in dB)
The radiated power can never be more than the power supplied by the transmitter. However as above, it can be concentrated into one direction in ways that make it appear more powerful than the same power from a diplole would be.
Sometime this extra strength is achieved by taking power that would radiate upwards from a dipole and concentrating it horizontally. This is done with TV transmitting antennas where 360 degree coverage is required horizontally, but there is no need for power to radiate upwards.