Derivation of van der Waals equation
In 1873, Van der Waals modified the Ideal Gas Equation and formulate Van der Waals equation of state for real gases.

P_{i}V_{i} = RT

By incorporating the size effect and intermolecular attraction effect of the real gas. These above two effects are discussing under the Volume Correction and Pressure Correction of the Ideal Gas Equation.
Volume Correction by Van der Waals

Molecules are assumed to be a hard rigid sphere and in a real gas, the available space for free movement of the molecules becomes less then V. let us take the available space for free movement of 1mole gas molecules,
Vi = (Vb)

where V is the molar volume of the gas and b is the volume correction factor.
Vi = molar volume of the ideal gas where the gas molecules are regarded as point masses.
Let us take, r is the radius of the molecule and σ = 2r is the diameter using the molecule as a rigid sphere.
An encounter of the gas molecules. 

Then it can be shown that the volume correction term or effective volume of onemole gas molecules,

b = 4 × N_{0} (^{4}/_{3}) π r^{3}

When two molecules encounter each other the distance between the centers of the two molecules would be σ. They can not approach beyond this distance. Thus the sphere of radius σ will occupy a space unavailable for a pair of molecules.

This excluded volume = ^{4}/_{3} π σ^{3} for a pair of molecules.
Thus a single molecule,
= ^{1}/_{2} × ^{4}/_{3} π σ^{3}
The effective volume for Avogadro number of molecules (present in 1mole gas),
b = N_{0} × ^{2}/_{3} × π σ^{3}
or, b = N_{0} × ^{2}/_{3} × π (2r)^{3}
or, b = 4 N_{0} × ^{4}/_{3} × π (r)^{3}
Thus, b = N_{0} × ^{2}/_{3} × π (2r)^{3}
∴ b = ^{2}/_{3} × N_{0} × π σ^{3}
or, b = N_{0} × ^{2}/_{3} × π (2r)^{3}
or, b = 4 N_{0} × ^{4}/_{3} × π (r)^{3}
Thus, b = N_{0} × ^{2}/_{3} × π (2r)^{3}
∴ b = ^{2}/_{3} × N_{0} × π σ^{3}

Thus b measures and helps to calculate the radius ( or diameter) of the gas molecule. The equation becomes,

P_{i} (Vb) = RT
Pressure Correction by Van der Waals
 The pressure of the gas is developed due to the wall collision of the gas molecules. But due to intermolecular attraction, the colliding molecules will experience an inward pull and so the pressure exerted by the molecules in real gas will be less than that if there had not been an intermolecular attraction as in ideal gas P_{i}.

Thus, P_{i} 〉P
or, P_{i} = P + P_{a}

Where P_{a} is the pressure correction term originating from attractive forces. Higher the intermolecular attraction in a gas, greater is the magnitude of P_{a}.
Pressure depends on both the frequency of molecular collisions with the walls and the impulse exerted by each collision. Both contributions are diminished by the attractive forces and the strength with which these operate is roughly proportional to the density of the molecules.
Therefore the average pressure exerted by the molecules is decreased by P_{a} is proportional to the square of the density.

P_{a} ∝ 1/V^{2}
Since density ∝ 1/V
∴ P_{a} = a/V^{2}

Where a = constant for the gas that measures the attractive force between the molecule.

Thus, P_{i} = P + (a/V^{2})

Using the two corrections we have Van der Waals equation for 1 mole Real Gas is,

(P + a/V^{2} )(Vb) = RT

To convert the equation for n moles volume has to change as it is the only extensive property in the equation.
Let V be the volume of n moles gas hence, V = v/n. Putting this term in the Van der Waals equation we have,
Van der Waals equation for n Moles Real Gas 
For the real gas a=0 but b≠0

We have Van der Waals Equation,
(P+ an^{2}/V^{2})(V  nb) = nRT but a=0
Hence, P = nRT/(V  nb) 〉P_{i}
Since, P_{i} = nRT/V only.
For the real gas a≠0 but b=0

It means that the molecular size effect (repulsive interaction) creates higher pressure than that observed by the ideal gas where molecules have no volume.

We have Van der Waals Equation,
(P+ an^{2}/V^{2})(V  nb) = nRT but b=0(no size).
Hence, P = (nRT/V  an^{2}/V^{2})ㄑP_{i}
Since, P_{i} = nRT/V only.
Thus, intermolecular attraction effect reduces the pressure of the real gases.
Units of Van der Waals Constant

From the Van der Waals Equation,
(P+ an^{2}/V^{2})(V  nb) = nRT
where P_{a} = an^{2}/V^{2}
Where P_{a} is the pressure correction term, called often the internal pressure of the gas.
Then, a = P_{a} × (V^{2}/n^{2})
 Thus the unit of a = atm lit^{2} mol^{2}

Again, nb = Unit of volume (say liter)
 Hence, the unit of b = lit mol^{1}
Significance of Van der Waals constants

‘a’ term originates from the intermolecular attraction and P_{a} = an^{2}/V^{2}. Thus, ‘a’ is a measure of internal pressure of the gas and so the attractive force between the molecules. Higher the value of ‘a’ grater is the intermolecular attraction and more easily the gas could be liquefied.
Thus, a of CO_{2} = 3.95 atm lit^{2} mol^{2} while, a of H_{2} = 0.22 atm lit^{2} mol^{2}.
Another constant, ‘b’ measures the molecular size and also a measure of repulsive forces. The value of b can also be utilized to calculate the molecular diameter(σ). The grater, the value of ‘b’ larger the size of the gas molecule.
Thus, b of CO_{2} = 0.04 lit mol^{1} while, b of H_{2} = 0.02 lit mol^{1}.
Boyle's temperature from Van der Waals equation

Mathematical condition for Boyle’s temperature is,
T_{B} = [d(PV)/dP]_{T} When P→0
From the Van der Waals Equation for 1 mole gas,
(P + a/V^{2})(V  b) = RT
or, P = RT/(V  b)  a/V^{2}
Hence, PV = {RTV/(V  b)}  a/V
Thus, T_{B} = [d(PV)/dP]_{T}
= [RT/(Vb){RTV/(Vb)^{2}}+a/V^{2}][(dV/dP)]_{T}
= [{RT(V  b)  RTV}/(V  b)^{2} + a/V^{2}] [(dV/dP)]_{T}
=[{ RTb/(V  b)^{2}} + a/V^{2}] [(dV/dP)]_{T}
But when T = T_{B},
[d(PV)/dP]_{T} = 0 and [(dV/dP)] ≠ 0
Thus, We have, RT_{B}b/(V  b)^{2} = a/V^{2}
or, T_{B} = (a/Rb) {(V  b)/V}^{2}
Since P → 0, V is large.
Thus, (V  b)/V ≃ 1
Hence,T_{B} = a/Rb 
Amagat curve from Van der Waals Equation
Amagat Curves 
Van der Waals equation for 1mole real gas,
(P + a/V^{2})(V  b) = RT
or, PV  Pb + (a/V) + (a/V^{2}) = RT
Neglecting the small term (a/V^{2}), we get,
PV = RT + Pb  (a/V)
Using the ideal gas equation for the small term,
a/V = aP/RT and taking Z = (PV/RT),
We have, Z = 1 + (1/RT){b  (a/RT} P
This Shows that Z = ∫(T, P)
(P + a/V^{2})(V  b) = RT
or, PV  Pb + (a/V) + (a/V^{2}) = RT
Neglecting the small term (a/V^{2}), we get,
PV = RT + Pb  (a/V)
Using the ideal gas equation for the small term,
a/V = aP/RT and taking Z = (PV/RT),
We have, Z = 1 + (1/RT){b  (a/RT} P
This Shows that Z = ∫(T, P)

This equation can be used to explain Amagat curve qualitatively at low pressure and moderate pressure region.
For CO_{2} Van der Waals constant ‘a’ is very high

Thus (a/RT) 〉b in the equation and {b  (a/RT)} =  ve .
That is the slope of Z vs P curve is ( ) for carbon dioxide at moderate pressure region. That is the value of Z decreases with the increase of Pressure and it is also found in the curve of carbon dioxide.
For H_{2} Van der Waals constant ‘a’ is very small

So, a/RT〈 b, slope of Z vs P curve for H_{2} becomes (+) ve and the value of Z increases with pressure.
(i) When T〈 T_{B}
or, T〈 a/Rb
or, b〈 a/RT
and {b−(a/RT)} = ()ve.
or, T〈 a/Rb
or, b〈 a/RT
and {b−(a/RT)} = ()ve.

That is the value of Z decreases with increases with P at the moderate pressure region of the curve of CO2, Z〈 1 and more compressible.
(ii) When T = T_{B} = a/Rb
or, b = a/RT
hence, {b  (a/RT)} = 0
or, b = a/RT
hence, {b  (a/RT)} = 0

That is Z = 1 the gas shows ideal behavior. The size effect compensates the effect due to the intermolecular attraction of the gas. Z runs parallel to P axis up to a certain range of pressure at the lowpressure region.
(iii) When T 〉TB
or, T 〉a/Rb
or, b 〉a/RT
hence {b  (a/RT} = (+)ve.
or, T 〉a/Rb
or, b 〉a/RT
hence {b  (a/RT} = (+)ve.

That is the value of Z increases with the increase of P when T 〉T_{B}.
The size effect dominates over the effect due to the intermolecular attraction. For hydrogen and helium, 0°C is greater then their T_{B} values and Z vs P slope becomes (+)ve.
At very lowpressure P→0 and high temperature, the volume is very large and both the size effect and attraction effect becomes negligible that is Pb and (a/RT) P are negligible and Z=1 that is the gas obeys ideal behavior.
Questions and Answers of Van der Waals equation
 Question
 Calculate the pressure of 2 moles of Nitrogen gas occupying 10 lit volume at 27^{0}C. Given, a = 1.4 atm lit^{2} mol^{2} and b=0.04 lit mol^{1} using Van der Waals equation.
Also, calculate the pressure of the gas using the ideal gas equation and find the extent of deviation from ideal behavior.
 Answer
 P = 4.904 atm, P_{i} = 4.92 atm and Deviation=0.325%
 Question

Find the Units and Dimensions of Van der Waals constant 'a' and 'b' from Van der Waals Equation.
 Answer
 In SI system,unit of 'a' = N m^{4} mol^{2}
In CGS system,unit of 'a' =dyne cm^{4} mol^{2}
In SI system,unit of 'b' = m^{3} mol^{1}
In CGS system,unit of 'b' = cm^{3} mol^{1}
 Question

Calculate the Boyle temperature of nitrogen gas given a=1.4 atm lit^{2} mol^{2} and b = 0.04 lit mol^{1}.
 Answer
 T_{B} = 427 K
 Question
Comment on the possibility of defining a Boyle Temperature if a=0 and a=b=0.
 Answer
 When, a = 0, Van der Waals Equation, P (V  b) = RT or, PV = RT + Pb Differentiating with respect of pressure at constant temperature, [d(PV)/dP]_{T} = b, but b ≠ 0 hence [d(PV)/dP]_{T} ≠ 0. The gas has no Boyle temperature since at any temperature since at any temperature, [d(PV)/dP]_{T} ≠ 0.
 Again when a = b = 0, Van der Waals equation becomes PV = RT; or, [d(PV)/dP]_{T} = 0.
That is at any temperature this becomes zero and so all the temperature are Boyle Temperatures.