The elimination by addition allows you to select one
of the factors of x or y. That is, you select either a, b, c, or d and
solve the equation by that factor. The user can easily do this by
examining the factors and selecting the factor that seems easier. Usually
a factor that is equal to 1 is the prime candidate. When you solve this
problem programmatically, you cannot know what factor would be the
simplest. Therefore, you can only pick up either a, b, c, or d.
Let's consider x and provide a relative solution to
the first equation:
==> ax + by = h
==> ax = h - by
h - by
==> x = --------
a
Let's solve the second equation with regards to x also
(remember that there is never "the solution" in mathematics,
only "a solution", or "one of the solutions"):
==> cx + dy = k
==> cx = k - dy
k - dy
==> x = --------
c
Now that we have eliminated y in both solutions, we
can equalize the new solutions :
h - by k - dy
==> ---------- = -----------
a c
==> c(h - by) = a(k - dy)
==> ch - cby = ak - ady
==> ch - ak = cby - ady
==> ch - ak = y(cb - ad)
/////////////////////////////////////////////////////////////////////
ch - ak
==> y = -----------
cb - ad
h - by
==> x = ----------
a
|