Because no
nuclear reactions take place in a chemical reaction, the
chemical elements pass through the reaction unchanged. Thus, each side of the chemical equation must represent the same number of atoms of any particular element (or
nuclide, if different
isotopes are taken into account). The same holds for the total
electric charge, as stated by the
charge conservation law. An equation adhering to these requirements is said to be
balanced. A chemical equation is balanced by assigning suitable values to the stoichiometric coefficients. Simple equations can be balanced by inspection, that is, by trial and error. Another technique involves solving a
system of linear equations. Balanced equations are usually written with smallest
natural-number coefficients. Yet sometimes it may be advantageous to accept a fractional coefficient, if it simplifies the other coefficients. The introductory example can thus be rewritten as :HCl + Na -> NaCl + 1/2 H2 In some circumstances the fractional coefficients are even inevitable. For example, the reaction corresponding to the
standard enthalpy of formation must be written such that one molecule of a single product is formed. This will often require that some reactant coefficients be fractional, as is the case with the formation of
lithium fluoride: :Li(s) + 1/2F2(g) -> LiF(s)
Inspection method gas on the reactants side and before the
water on the products side in order for, as per the law of conservation of mass, the quantity of each element does not change during the reaction + 6
H2O → 4
H3PO4This chemical equation is being balanced by first multiplying H3PO4 by four to match the number of P atoms, and then multiplying H2O by six to match the numbers of H and O atoms. The method of inspection can be outlined as setting the most complex substance's stoichiometric coefficient to 1 and assigning values to other coefficients step by step such that both sides of the equation end up with the same number of atoms for each element. If any
fractional coefficients arise during this process, the presence of fractions may be eliminated (at any time) by multiplying all coefficients by their
lowest common denominator. ; Example Balancing of the chemical equation for the complete
combustion of
methane :::\mathord{?}\,{CH4} + \mathord{?}\,{O2} -> \mathord{?}\,{CO2} + \mathord{?}\,{H2O} is achieved as follows: • A coefficient of 1 is placed in front of the most complex formula (
CH4): • :1 {CH4} + \mathord{?}\,{O2} -> \mathord{?}\,{CO2} + \mathord{?}\,{H2O} • The left-hand side has 1
carbon atom, so 1 molecule of
CO2 will balance it. The left-hand side also has 4
hydrogen atoms, which will be balanced by 2 molecules of
H2O: • :1 {CH4} + \mathord{?}\,{O2} -> 1 {CO2} + 2 H2O • Balancing the 4
oxygen atoms of the right-hand side by 2 molecules of
O2 yields the equation • :1 CH4 + 2 O2 -> 1 CO2 + 2 H2O • The coefficients equal to 1 are omitted, as they do not need to be specified explicitly: • :CH4 + 2 O2 -> CO2 + 2 H2O • It is wise to check that the final equation is balanced, i.e. that for each element there is the same number of atoms on the left- and right-hand side: 1 carbon, 4 hydrogen, and 4 oxygen.
System of linear equations For each chemical element (or nuclide or unchanged
moiety or charge) , its conservation requirement can be expressed by the
mathematical equation :\sum_{j\,\in\,\text{reactants}} \!\!\!\!\! a_{ij} s_j \ = \!\!\!\!\! \sum_{j\,\in\,\text{products}} \!\!\!\!\! a_{ij} s_j where : is the number of atoms of element in a molecule of substance (per formula in the chemical equation), and : is the stoichiometric coefficient for the substance . This results in a
homogeneous system of linear equations, which are readily solved using mathematical methods. Such system always has the all-zeros
trivial solution, which we are not interested in, but if there are any additional solutions, there will be infinite number of them. Any non-trivial solution will balance the chemical equation. A "preferred" solution is one with
whole-number, mostly positive stoichiometric coefficients with
greatest common divisor equal to one.
Example Let us assign variables to stoichiometric coefficients of the chemical equation from the previous section and write the corresponding linear equations: :\mathit{s}_1 {CH4} + \mathit{s}_2 {O2} -> \mathit{s}_3 {CO2} + \mathit{s}_4 {H2O} \quad\;\;\; \begin{align} \text{C:} && s_1 & = s_3 \\ \text{H:} && 4s_1 & = 2s_4 \\ \text{O:} && 2s_2 & = 2s_3 + s_4 \end{align} All solutions to this system of linear equations are of the following form, where is any
real number: :\begin{align} s_1 & = r \\ s_2 & = 2r \\ s_3 & = r \\ s_4 & = 2r \end{align} The choice of yields the preferred solution, :\begin{align} s_1 & = 1 \\ s_2 & = 2 \\ s_3 & = 1 \\ s_4 & = 2 \end{align} which corresponds to the balanced chemical equation: :CH4 + 2 O2 -> CO2 + 2 H2O
Matrix method The system of linear equations introduced in the previous section can also be written using an efficient
matrix formalism. First, to unify the reactant and product stoichiometric coefficients , let us introduce the quantity :\nu_j = \begin{cases} -s_j & \text{for a reactant} \\ +s_j & \text{for a product} \end{cases} called
stoichiometric number, which simplifies the linear equations to :\sum_{j=1}^J a_{ij} \nu_j=0 where is the total number of reactant and product substances (formulas) in the chemical equation. Placement of the values at row and column of the composition matrix :\begin{bmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,J} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,J} \\ \vdots & \vdots & \ddots & \vdots \end{bmatrix} and arrangement of the stoichiometric numbers into the stoichiometric vector :\begin{bmatrix} \nu_1 \\ \nu_2 \\ \vdots \\ \nu_J \end{bmatrix} allows the system of equations to be expressed as a single
matrix equation: : Like previously, any nonzero stoichiometric vector , which solves the matrix equation, will balance the chemical equation. The set of solutions to the matrix equation is a
linear space called the
kernel of the matrix . For this space to contain nonzero vectors , i.e. to have a positive
dimension N, the columns of the composition matrix must not be
linearly independent. The problem of balancing a chemical equation then becomes the problem of determining the N-dimensional kernel of the composition matrix. Only for N = 1 will there be a unique preferred solution to the balancing problem. For N > 1 there will be an infinite number of preferred solutions with N of them linearly independent. If N = 0, there will be only the unusable trivial solution, the zero vector. Techniques have been developed to quickly calculate a set of N independent solutions to the balancing problem, which are superior to the inspection and in that they are determinative and yield all solutions to the balancing problem. ; Example Using the same chemical equation again, write the corresponding matrix equation: :\mathit{s}_1 {CH4} + \mathit{s}_2 {O2} -> \mathit{s}_3 {CO2} + \mathit{s}_4 {H2O} : \begin{matrix} \text{C:} \\ \text{H:} \\ \text{O:} \end{matrix} \quad \begin{bmatrix} 1 & 0 & 1 & 0 \\ 4 & 0 & 0 & 2 \\ 0 & 2 & 2 & 1 \end{bmatrix} \begin{bmatrix} \nu_1 \\ \nu_2 \\ \nu_3 \\ \nu_4 \end{bmatrix} = \mathbf{0} Its solutions are of the following form, where is any real number: : \begin{bmatrix} \nu_1 \\ \nu_2 \\ \nu_3 \\ \nu_4 \end{bmatrix} = \begin{bmatrix} -s_1 \\ -s_2 \\ s_3 \\ s_4 \end{bmatrix} = r \begin{bmatrix} -1 \\ -2 \\ 1 \\ 2 \end{bmatrix} The choice of and a
sign-flip of the first two rows yields the preferred solution to the balancing problem: : \begin{bmatrix} -\nu_1 \\ -\nu_2 \\ \nu_3 \\ \nu_4 \end{bmatrix} = \begin{bmatrix} s_1 \\ s_2 \\ s_3 \\ s_4 \end{bmatrix} = \begin{bmatrix} 1 \\ 2 \\ 1 \\ 2 \end{bmatrix} ==Ionic equations==