Balance chemical equations without trial and error? In my AP chemistry class, I often have to balance chemical equations like the following:
$$ \mathrm{Al} + \text O_2 \to \mathrm{Al}_2 \mathrm O_3 $$
The goal is to make both side of the arrow have the same amount of atoms by adding compounds in the equation to each side.
A solution:
$$ 4 \mathrm{Al} + 3 \mathrm{ O_2} \to 2 \mathrm{Al}_2 \mathrm{ O_3} $$
When the subscripts become really large, or there are a lot of atoms involved, trial and error is impossible unless performed by a computer. What if some chemical equation can not be balanced?  (Do such equations exist?) I tried one for a long time only to realize the problem was wrong.
My teacher said trial and error is the only way. Are there other methods?

Given that:
$$Al+O_2\to Al_2O_3,$$
introduce variable coeffecient i.e:
$$sAl+cO_2\to eAl_2O_3.$$
Comparing coeffecient on both sides


*

*Comparing A: $1s=2e$;

*Comparing O: $2c=3e$.


When $e=2$, $S=2\cdot2=4$. Again, $2c=3\cdot2\implies c=3$. Hence $e=2$,  $s=4$ and $c=3$:
$$4Al+3O2\longrightarrow 2Al_2O_3.$$
