McCoy 1

McCoy 1
Application of Linear Algebra: Balancing Chemical Equations
Becca McCoy
Chemistry is the study of matter and of the changes matter undergoes (Karayannis 9). A
chemical equation describes the products of a reaction that from the starting molecules or atoms.
Chemistry seeks to predict the products that result from the reaction of specific quantities of
atoms or molecules. Chemists accomplish this task by writing and balancing chemical
Before one can solve a chemical equation, there has to be an understanding of the
information provided. The reactants are the substances on the left side of the equation which
react to produce the products on the right side of the chemical equation. The arrow in a chemical
equation represents that the chemical change that the reactants undergo to become the products.
For the purpose of this paper, the arrow can be thought of as an equal sign. More than one set of
products could be created from the same reactants. There are many different factors that affect
which products will be formed such as the conditions in which the reaction takes place and the
stability of the products. Predicting the actual products that will be made requires further
knowledge of chemistry. Once an equation is known, it is possible to predict the quantity of
reactants needed to form a certain amount of product.
The law of conservation of mass states that matter cannot be destroyed or created (Brown
78). Therefore, the products in a chemical equation must come from a rearrangement of the
reactants. If there is not enough of one reactant to completely react with another, then the
reactant there is not enough of is called the limiting reagent (Brown 99). It is wasteful and not
helpful to have limiting reagents. The stoichiometric amount of each chemical does not allow for
a limiting reagent. Chemists correct this issue by using stoichiometric amounts of each reactant,
which can be found using the chemical equation.
The law of definite proportions states that each unique molecule always contains the
same proportion of elements by mass (Brown 10). The law of definite proportion must be
understood in order to be able to utilize linear algebra in balancing chemical equations. Because
each unique molecule is defined by the different ratios of the elements it contains, linear algebra
can help determine the quantity of products that will be formed from certain ratios of reactants.
The last law that is important for solving chemical equations is called the law of multiple
proportions. The law of multiple proportions states that the ratios of the masses of the elements
will be ratios of small whole numbers (Brown 40-41). Therefore, the matrices solved must
contain whole numbers. The law of multiple portions adds a step to the normal solving of
matrices. All of the coefficients have to be checked to make sure that they are the lowest
possible whole number ratios.
Simple chemical equations describe two atoms combining in some way to make a
molecule. This type of reaction is called synthesis (Sibert). An example of an unbalanced
synthesis reaction is shown in Figure 1.
( )
( )→
Figure 1. This chemical equation describes the reaction of oxygen gas and hydrogen gas to
produce a water molecule. The letters in parenthesis symbolize the state of the atom or
molecules. The letter “g” stands for gas, “l” for liquid, and “s” for solid. While these are
McCoy 2
important facts for predicting the products, it is not vital to know states of molecules in order to
solve the equation.
The chemical equation in Figure 1 is not balanced. There are two oxygen atoms on the
reactant sides and only one on the product side. In order for this chemical equation to be useful,
it must be balanced. Because mass can neither be created or destroyed in a reaction so there has
to be the same number of each type of atom on each side.
In general chemistry, students are taught to solve chemical equations through a structured
guessing game. The method taught is valid, but the process becomes harder as the equations get
more complicated. The process is as follows:
1) Count the number of each different atom in the reactants and then in the products.
2) Start with the most complicated looking molecule. This molecule would be the one
that contains the most atoms. Coefficients are added in front of each molecule to
balance the equation so that each side of the equation has the same number of atoms
of each type.
3) Move to the simple reactants. These reactants are usually made of just one atom.
Make sure to save oxygen and hydrogen for last. These elements usually complicate
the balancing process.
4) Continue until equation is balanced.
5) Make sure all coefficients are the lowest possible ratio. (Glaister)
There are a few addition rules for the balancing process. For instance, the subscripts
cannot be changed. The subscripts are unique to each molecule, so changing the subscripts
would change the molecule and thus the chemical equation. The goal is to balance the chemical
equation given by adding coefficients in front of each molecule. The process described here is a
kind of guessing game. One coefficient is added to see if it works. The process is continued until
the equation is balanced.
Now, the chemical equation in Figure 1 can be balanced. Two hydrogen atoms and two
oxygen atoms react to produce a molecule that has two hydrogen atoms and one oxygen atom.
The hydrogen atoms are balanced in the chemical equation, but the oxygen atoms are not. Since
the product, H2O, looks the most complicated, it is wise to start there. To balance the oxygen
atoms, the product needs to be multiplied by two. That takes care of the oxygen atoms, but it
causes the hydrogen atoms to become unbalanced. To counteract the addition of two hydrogen
atoms on the right, the hydrogen molecule on the left should be multiplied by two. Therefore,
the chemical equation has four hydrogen atoms on the left and four hydrogen atoms on the right.
It also has two oxygen atoms on the left and two oxygen atoms on the right. The coefficients 1,
2, and 2 are in the lowest possible ratios. The chemical equation is now balanced and ready for
use. The balanced chemical equation is written out in Figure 2.
( )
( )→
Figure 2. The balanced equation of one mole of oxygen gas and two moles of hydrogen gas
reacting to from two moles of water is displayed (“Matrices in Chemistry”). A mole is a
measurement in chemistry. It is a specific number of atoms or molecules (6.022 x 1023).
A lot of information can be gathered from this chemical equation. The ratio of the
coefficients of the reactants is the stoichiometric ratio required in order for there to be no wasted
McCoy 3
material. If a higher ratio were used, say one mole of oxygen gas and three moles of hydrogen
gas, then the oxygen gas would then become a limiting reagent. There would be one molecule of
hydrogen gas that was wasted in this experiment.
The process described above works effectively, and it is beneficial to use for simple
chemical equations. However, the process becomes complicated when an atom is present in two
different molecules on the same side of the reaction. A simple example of this type of reaction is
called a combustion reaction. The chemical equation for a common combustion reaction is
shown in Figure 3.
( )
( )→
( )
Figure 3. This chemical equation shows the reaction of methane gas with oxygen gas to produce
carbon dioxide and water (Matrices).
The chemical equation in Figure 3 has one carbon atom, four hydrogen atoms, and two
oxygen atoms on the left. On the right, there are three oxygen atoms (two oxygen atoms one
molecule and one oxygen atom in another), two hydrogen atoms, and one carbon atom. The
carbon atoms would be balanced first, but in this chemical equation, the carbons are already
balanced. Therefore, the most complex molecule is studied next. Methane or water is a good
choice. Starting with methane makes the process easier, because the carbon is already balanced.
There are four hydrogen atoms in methane, which implies that the water molecule needs to be
multiplied by two. Next, the oxygen atom needs to be balanced. There are two oxygen atoms on
the left and four on the right. Therefore, the oxygen gas on the right side needs to be multiplied
by two. The coefficients (1,2,1,2) are examined to ensure they are the lowest possible ratios.
Figure 4 shows the balanced chemical equation.
( )
( )→
( )
Figure 4. The balanced chemical equation has one mole of methane reacting with two moles of
oxygen gas to form one mole of carbon dioxide and two moles of water.
Balancing the chemical equation in Figure 3 was possible, but it required more work.
The chemical equations that need to be balanced only get more complicated. The chemical
equation in Figure 5 is very complicated. Finding the coefficients using guess work would take a
very long time. However, this task can be accomplished efficiently using linear algebra.
Figure 5 (Nehme). This chemical equation is very long and complex. Many of the molecules are
unfamiliar to beginning chemistry students, which makes balancing the chemical equation even
harder. Using linear algebra can take away the trouble of not recognizing molecule.
The chemical equation in Figure 5 will be balanced, after the process of solving chemical
equations with matrices has been explained.
McCoy 4
The chemical equation in figure 1 will be used to explain the process. The information
stored in the chemical equation is translated to matrices with the column space representing each
molecule and the row space representing each element.
( )
( )→
An equation for this chemical equation is formed. It is important to keep all molecules
together. Each grouping of atoms separated by a plus sign must stay together. Also, the
subscripts cannot be changed. The subscripts describe how many of that atom makes up the
The equation for each atom looks like:
O: 2a + 0b = 1c
H: 0a + 2b = 2c
Where a = the first molecule coefficient (O2), b = the second molecule coefficient (H2),
and c = the third molecule coefficient (H2O).
To form the matrices, each equation needs to have all the variables on one side and the
equation needs to be equal to zero. To accomplish this, one side is subtracted from the other.
The final equations look like:
O: 2a + 0b - 1c = 0
H: 0a + 2b -2c = 0
These equations are preserving the law of conversation of mass. The same amount of
each atom must be present on both sides of the chemical equation.
The equations are then transformed into a matrix. The first column in matrix A represents
H2, the second column represents O2, and the third column represents H2O. The first row
represents the oxygen atoms and the second row represents the hydrogen atoms. Since there are
two different atoms and three different molecules, the matrix A will be a two by three matrix.
a 
 2 0  1    0 
0 2  2 b   0
c   
 
a 
2 0  1 
0 
, x  b, b   
Where A  
0 2  2
0 
 c 
With the equation written the form Ax = 0, it should be easy to recognize the answer.
The solution is the kernel, or the null space, of the first matrix (Bretscher 115). The first value
given in the kernel will be the coefficient a, the second coefficient b, and the third coefficient c.
The first step to solving for the kernel is to take the first matrix and perform row
operations to achieve the reduce row echelon form of the matrix. The reduced row echelon form
is a matrix that follows three rules. The rules are: the first nonzero number in each column is a
one and is the only nonzero entry in that column (this is called a leading one or pivot), rows of
McCoy 5
zero are at the bottom, and every leading one is to the right of the leading one above it (Bretscher
16). The reduced row echelon form of matrix A is shown below.
1 0  1 / 2
rref (A)  
0 1  1 
The reduced row echelon form was found by matrix row operations. Both rows were
divided by two. The resulting matrix was the reduced row echelon form of the matrix.
Performing these operations did not change the information stored in the matrix.
Then the matrix equation is solved to find the solution. The reduced row echelon form of
matrix A makes it easier to identify the kernel of the matrix. The kernel is the values of a, b, and
c that bring the matrix to the zero vector. For the first row, it is easy to see that one times the
first entry plus two times the third entry equals zero. For the second row, one times the second
entry plus two times the third entry equal zero. But the coefficients for the third entry must be
the same for both equations. The second row is then two times the second entry plus two times
the third entry.
a 
1 0  1 / 2   0
0 1  1  b  0
 c   
 
 a  1 
ker( A)  b   2
 c  2
The last step is to make sure that the answer is given in the lowest whole number ratio
possible. For this equation, the answer came out in the lowest whole numbers possible and gives
the coefficients for the balanced chemical equation.
To check the answer obtained, it can be plugged back into the equations formed to make
the matrix.
O: 2(1) + 0(2) = 1(2)
H: 0(1) + 2(2) = 2(2)
The balanced chemical equation is displayed below. The solutions agree with the
solution found by the traditional way of solving chemical equations.
( )
( )→
The value of being able to solve chemical equations by manipulation of matrices is not
fully appreciated when the chemical equation is simple. But the process is consistent for all
McCoy 6
chemical equations. Even when solving a more complex chemical equation, the process for
solving for the solution by finding the kernel is the same.
The chemical equation in figure 3 will be solved next with linear algebra.
( )
( )→
( )
The chemical equation written above is considered harder, because the oxygen atom is
present in different forms on the same side of the chemical equation. In solving chemical
equations with linear algebra, the presence of the same atom twice does not make the process
any harder. The same steps are followed, because the use of the matrix checks the repeating atom
without the solver having to think about it.
Therefore, the equations look similar to the example above, except that there are three
different atoms and four different molecules.
C: 1a + 0b - 1c - 0d = 0
H: 4a + 0b - 0c - 2d = 0
O: 0a + 2b - 2c - 1d = 0
The matrix that results is a 3 by 4 matrix.
a 
1 0  1 0    0 
4 0 0  2 b   0
 c   
0 2  2  1   0
d 
To solve for the reduced row echelon form, the same process from above is followed. It
requires a few more row operations, but it is just simple arithmetic. The second row is
subtracted by four times the first row. The second row is divided by negative four. Row three is
divided by two. The third row is subtracted from the second row. The second row is added to the
first row. Then rows two and three are swapped.
1 0 0  1 / 2
rref (A)  0 1 0  1 
0 0 1  1 / 2
The reduced row echelon form of matrix A makes it easier to find the kernel of matrix A.
 a  1 
b  2
ker( A)      
 c  1 
   
d  2
The kernel is checked to make sure that the entries are in the lowest whole number ratios.
The solutions given by the kernel are inserted back into the chemical equation, and the chemical
equation is checked to make sure it is balanced.
McCoy 7
( )
( )→
( )
The chemical equation reported above is the same as the one displayed in figure 4. The
chemical equation is balanced.
The same process used for the other two chemical equations can be used for the chemical
equation in figure 5. Even large complex chemical equations can be turned into matrices. One
thing to remember for this chemical equation is to treat polyatomic units that stay in the same
form on both sides of the chemical equation as though they were one element. For example
PO4 is on both sides and it considered as a unit instead of one phosphorus atom and four oxygen
atoms separately. These unites are called polyatomic ions. The parentheses are around the units
that will be treated the same as atoms.
)→ (
) (
From this equation, there are six molecules and six different atoms and polyatomic ions.
The matrix that will result is a six by six matrix.
H: 3a + 0b + 1c - 0d - 0e - 2f = 0
PO4: 1a + 0b + 0c - 1d - 0e - 0f = 0
NH4: 0a + 2b + 0c - 3d - 1e - 0f = 0
Mo: 0a + 1b + 0c - 12d - 0e - 0f = 0
O: 0a + 4b + 0c - 36d - 0e - 1f = 0
NO3: 0a + 0b + 1c - 0d - 1e - 0f = 0
The matrix equation is shown below.
 2   a  0 
0 1 0
0  b  0
0  3  1 0   c  0 
    
0  12 0
0  d  0
0  36 0  1  e  0
   
 1 0   f  0
0 1
Even though this matrix has more entries, the process for solving for the reduced row
echelon form is the same. The reduced row echelon form of the matrix is shown below.
McCoy 8
rref ( A)  
0 0 0 0  1 / 12
1 0 0 0
 1 
0 1 0 0  7 / 4
0 0 1 0  1 / 12
0 0 0 1  7 / 4
0 0 0 0
0 
From the reduced row echelon, the kernel of the matrix is found.
a   1 
b  12
   
 c  21
ker( A)      
d   1 
 e  12
   
 f  21
The solutions found in the kernel are checked to make sure they are in the lowest possible
whole number ratios. Then the coefficients are balanced in the chemical equation and it is
This chemical equation would have been very difficult to balance using the traditional
process. With six different molecules made up of a mixture of six different atoms and
polyatomic ions, it is easy to make simple arithmetic mistakes. Using a matrix to solve the
chemical equation minimizes the places that mistakes can be made.
The traditional process for balancing chemical equations has to be computed by hand,
because it involves intuitive thinking. Using linear algebra makes the calculations simple. The
matrix can be plugged into a calculator or a computer system and it can produce the answers
within seconds. Being able to use matrices for balancing chemical equations increases accuracy
and decreases the amount of time used.
No matter the size or the complexity of a chemical equation, the same process for solving
the chemical equation is used. The process for balancing chemical equations is:
1) From the information given in a chemical equation, produce equations for each atom and
polyatomic ion. Each molecule should be kept together. The subscripts of molecules
cannot be changed.
2) Transform the equations into a matrix equation. Each row of matrix A should represent
an atom or a polyatomic ion. Each column of matrix A should represent a molecule from
the chemical equation.
3) Find the reduced row echelon form of matrix A by using row operations.
McCoy 9
4) Solve the reduce row echelon form of matrix A to find the kernel.
5) Check that the kernel of matrix A has entries that in the lowest possible whole number
6) Insert the kernel into the chemical equation.
7) Check to make sure the chemical equation is balanced.
One pitfall for this process is when the charge on an atom changes. This type of equation is
chemical equation is called a redox reaction. In order to solve redox reactions, the charge has to
be balanced as well as the mass. Linear algebra does not help balance these chemical equations
Being able to balance chemical equations efficiently and correctly is vitally important for
chemistry. Using the correct stoichiometric amounts of chemicals reduces waste and minimizes
the chances of a chemical equation that was not expected. Many reactions are concentration
dependent. If too much of one chemical is present, it could undergo a different reaction and
produce something that could potentially be hazardous.
Applying basic linear algebra definitions to solving chemical equations is very helpful. The
process can change from being a guessing game to a mathematical process. Many students in
introductory chemistry struggle with balancing chemical equations, because it requires multiple
steps that are unique for each chemical equation. Linear algebra removes the differences and
unites the process for all chemical equations.
McCoy 10
Bretscher, Otto. Linear Algebra with Applications. 5th ed. Boston: Pearson Education, Inc.,
2013. 16, 110-119. Print.
Brown, Theodore L., H. Eugene Jr. Lemay, et al. Chemistry, The Central Science. 12th ed.
Boston: Prentice Hall, 2012. Print.
Glaister, P. "A Chemical Balancing Act." Teaching Mathematics and Its Applications. 4th ed.
Vol. 14. N.p.: n.p., 1996. 178-82. Advanced Placement Source. Web. 7 Mar. 2013.
Karayannis, Miltiades I., and Constantinos E. Efstathiou. "Significant Steps in the Evolution of
Analyical Chemistry- Is the Today's Analytical Chemistry Only Chemistry?" Talanta 0th
ser. 102 (2012): 7-15. EBSCOhost. Web. 8 Apr. 2013.
Nehme, Zeina. "Applications of Linear Algebra." Applications of Linear Applications. NDU, 29
Apr. 2011. Web. 07 Mar. 2013.
"Matrices in Chemistry." Schodor. The University of North Carolina at Chapel Hill: Department
of Chemistry, n.d. Advanced Placement Source. Web. 07 Mar. 2013.
Sibert, Gwen. "Types of Equations." Types of Equations. SciLinks, n.d. Web. 08 Apr. 2013.