# Solving this linear system based on the combustion of methane, has no constants

I recently discovered that I could solve a chemical reaction using a linear system. So I thought I would try something simple like the combustion of methane.

where x y z and w are the moles of each molecule

x $CH_4$ + y $O_2$ = z $H_2$O + w C$O_2$

the linear system for this would be:

x = w
2y = z + 2w
4x = 2z


I got as far as y = z and y = 2w but without any constants, I am stumped. Can anyone help me? I was assuming that elimination and substitution would suffice, but I must be wrong.

-

You have three equations with four unknowns, which should lead you to expect a single undefined parameter. In this case you can multiply all your variables by any constant and still have a fine set of equations. The easiest cure is to set one of them to $1$. Maybe you choose $x=1$. Then you should be able to solve the rest easily. This would represent burning $1$ mole of methane. If you burned $2$ moles, you would have twice as much of each other reactant.

-
thanks, that makes it a lot simpler to work it out. – pying saucepan Aug 26 '12 at 21:49

I think the reason for this is because there is an infinite number of values for each variable. I know you want the answer in the least common terms, but the terms can always be multiplied higher. Assign any random value to any random variable, and solve it from there. From the four variable answers you get, if there are no decimals, then reduce them to least common terms. If there is a decimal, then find a suitable integer to multiply each constant with to make them all integers.

For instance, make X = 1. So W = 1. Z=2, and Y=2. Suppose you did like, Z = 1. Then X=1/2, W=1/2, and Y=1. To get rid of the 1/2's, multiply everything by 2.

-

At some point you have to introduce some kind of parameter (for instance letting $x=t$ for $t\in\mathbb{N}$) or just fix one variable (e.g. $x=1$).

This is required because you got $4$ variables but only $3$ independent equations. This fact can also intuitively be made clear because you can choose to burn $2$ methane molecules or $90$ or one million. If the combustion equation is fulfilled for any $x,y,z,w$, then it will be true for integer multiples of all values.

-

Each of your equations can be rearranged to give $$x-w=0$$ $$2y-z-2w=0$$ $$4x-2z=0$$ Your idea of using Gaussian elimination is then a very good one. Or you can solve directly. From the first equation, you get $$x=w.$$ From the third equation, you get $$z=\frac{x}{2}=\frac{w}{2}.$$ Then from the second equation you get $$y=\frac{z}{2}+w=\frac{5w}{4}.$$ In each subsequent equation, we have used previous information and any value for $w$ will suffice ($w$ is called a free variable).

Note that this makes sense as $w$ is a particular number of type atoms and changing it will change how the equation is to be balanced.

-