Theory:

Benoît Paul Émile Clapeyron first proposed the ideal gas equation in $$1834$$ as a combination of Boyle's law, Charles's law and Avogadro's law

The ideal gas equation, also called the ideal gas law, is the equation of the state of a hypothetical ideal gas. It is a good estimate of the behaviour of many gases under many conditions, although it has several limitations.
Deriving the ideal gas equation:

The ideal gas equation is an equation, which relates all the properties of an ideal gas.

An ideal gas obeys Boyle’s law and Charles’ law, and Avogadro’s law.

According to Boyle’s law,

$V\phantom{\rule{0.147em}{0ex}}\propto \phantom{\rule{0.147em}{0ex}}\frac{1}{P}\phantom{\rule{0.147em}{0ex}}\mathit{at}\phantom{\rule{0.147em}{0ex}}\mathit{Constant}\phantom{\rule{0.147em}{0ex}}n\phantom{\rule{0.147em}{0ex}}\mathit{and}\phantom{\rule{0.147em}{0ex}}T$ ----- (Eq. 1)

According to Charles’s law,

$V\phantom{\rule{0.147em}{0ex}}\propto \phantom{\rule{0.147em}{0ex}}T\phantom{\rule{0.147em}{0ex}}\mathit{at}\phantom{\rule{0.147em}{0ex}}\mathit{Constant}\phantom{\rule{0.147em}{0ex}}n\phantom{\rule{0.147em}{0ex}}\mathit{and}\phantom{\rule{0.147em}{0ex}}P$ ----- (Eq. 2)

$V\phantom{\rule{0.147em}{0ex}}\propto \phantom{\rule{0.147em}{0ex}}n\phantom{\rule{0.147em}{0ex}}\mathit{at}\phantom{\rule{0.147em}{0ex}}\mathit{Constant}\phantom{\rule{0.147em}{0ex}}P\phantom{\rule{0.147em}{0ex}}\mathit{and}\phantom{\rule{0.147em}{0ex}}T$ ----- (Eq. 3)

Combining equations (Eq. 1), (Eq. 2) and (Eq. 3),

$V\phantom{\rule{0.147em}{0ex}}\propto \phantom{\rule{0.147em}{0ex}}\frac{\mathit{nT}}{P}$

The above equation shows that the volume of a gas ($$V$$) is proportional to the number of moles ($$n$$) and the temperature ($$T$$) and is inversely proportional to the pressure ($$P$$). This expression can also be written as,

$V\phantom{\rule{0.147em}{0ex}}=\mathit{Cons}.\phantom{\rule{0.147em}{0ex}}\left(\frac{\mathit{nT}}{P}\right)\phantom{\rule{0.147em}{0ex}}$

Rearranging the equation,

$\frac{\mathit{PV}}{\mathit{nT}}\phantom{\rule{0.147em}{0ex}}=\mathit{Constant}$ ----- (Eq. 4)

The above relation is called the combined law of gases.

Consider a gas, which contains $\mathrm{\mu }$ moles of the gas. The number of atoms contained will be equal to $\mathrm{\mu }$ times the Avogadro constant, ${N}_{A}$. The value of Avogadro numbers is .

That is,

$n\phantom{\rule{0.147em}{0ex}}=\phantom{\rule{0.147em}{0ex}}\mathrm{\mu }{N}_{A}$ ----- (Eq. 5)

Substitute Eq. 5 to Eq. 4. And, then the Eq. 4 can be written as,

$\frac{\mathit{PV}}{\mathit{nT}}\phantom{\rule{0.147em}{0ex}}=\mathit{Constant}\phantom{\rule{0.147em}{0ex}}⇒\phantom{\rule{0.147em}{0ex}}\frac{\mathit{PV}}{\mathrm{\mu }{N}_{A}T}\phantom{\rule{0.147em}{0ex}}=\mathit{Constant}$ ----- (Eq. 6)

The value of the constant in the above equation is taken to be ${K}_{B}$, which is called as Boltzmann constant ($1.38×{10}^{-23}\phantom{\rule{0.147em}{0ex}}J{K}^{-1}$).

Hence, we have the following equation:

$\phantom{\rule{0.147em}{0ex}}\frac{\mathit{PV}}{\mathrm{\mu }{N}_{A}T}\phantom{\rule{0.147em}{0ex}}={K}_{B}$ ----- (Eq. 7)

Rearranging the above equation,

$\phantom{\rule{0.147em}{0ex}}\mathit{PV}\phantom{\rule{0.147em}{0ex}}={\phantom{\rule{0.147em}{0ex}}\mathrm{\mu }{N}_{A}TK}_{B}$ ----- (Eq. 8)

Here, $\phantom{\rule{0.147em}{0ex}}{\mathrm{\mu }{N}_{A}K}_{B}\phantom{\rule{0.147em}{0ex}}=\phantom{\rule{0.147em}{0ex}}R$, which is termed as universal gas constant whose value is $8.31\phantom{\rule{0.147em}{0ex}}J{\mathit{mol}}^{-1}{K}^{-1}$.

Substitute the value of $$R$$ in Eq. 8,

$\phantom{\rule{0.147em}{0ex}}\mathit{PV}\phantom{\rule{0.147em}{0ex}}=\mathit{RT}$

The ideal gas equation is also called the equation of state because it gives the relation between the state variables and is used to describe the state of any gas.