0

This seems like a very simple question, and I apologize if that is the case. In trying to prove the result in general, I ran into an issue with something I think I should understand but don't fully.

Say I have a system of equations \begin{align*} ax + by &= r \\ cx + dy &= s \end{align*} and I require that $ad - bc \neq 0$. Suppose that, using elimination, I solve for $y$ in terms of $x$. I then want to back-substitute into one of the above equations to solve for $x$.

My question is this. This could, in principle, go wrong, but it shouldn't in this case. It's possible I could use equation (1) above and solve for $x$, and then plug my resulting $(x,y)$ pair into equation (2) and get a contradiction. There's no good reason for me to choose equation (1) over equation (2), but there's some reason that I should be able to use just one of them and be confident that my answer is still correct. My question is, why is that the case?

The alternative is, I could use elimination again, starting from the top, and find $x$ entirely in the same way, in which case there shouldn't be any such problems, but I'm mostly interested in why substitution works here.

Cardinality
  • 1,097
  • 3
  • 7
  • As long as every step you take is mathematically justifiable, it doesn't matter which equation you start with, nor which variable you eliminate. You can't go wrong adding the same thing to both sides of an equation, or multiplying both sides of an equation by the same number – none of that is going to change to solution to a system. – Gerry Myerson Aug 15 '22 at 09:06
  • @GerryMyerson While that makes sense to me, I'm attempting to use the original equations, after having found $y$, to find $x$. It seems possible to me that each equation could give a different result for $x$. – Cardinality Aug 15 '22 at 09:08
  • So long as $ad - bc \neq 0$, anything sensible you do (adding or multiplying by a constant, adding or subtracting equations, substituting) will keep the solutions the same. In the worst case you end up with the unhelpful but not wrong $0=0$, e.g. by substituting $x=\frac{r-by}{a}$ [with $a \not=0$] into $ax+by=r$ and need to try something else, but otherwise the sensible things you can do cannot alter the solution. There are things which are bad (such as division by $0$) or risk introducing spurious solutions (such as squaring both sides), so you need to be careful. – Henry Aug 15 '22 at 09:19
  • You can change the order of equations and also reorder the variables, so if whatever you are doing is valid for one of those orders it is also valid for any other one by symmetry. – Michal Adamaszek Aug 15 '22 at 09:19
  • @Henry This may be obvious, but why does squaring both sides of the equation risk introducing spurious solutions? I'm trying to understand what is so special about $ad - bc \neq 0$, other than the fact that it allows me to solve for $x$ via division by a non-zero quantity. – Cardinality Aug 15 '22 at 09:31
  • A simple example with squaring is that $x-5=-2$ has one solution of $x=3$ but squaring gives $(x-5)^2=4$ which has two solutions of $x=3$ or $x=7$ since squaring has introduced the possibility that $x-5=+2$ – Henry Aug 15 '22 at 09:36
  • $ad - bc \neq 0$ is saying the determinant of the equations is non-zero. This is equivalent to saying that the associated matrix is invertible, allowing you to find a solution. If the determinant were $0$ then there would either be an infinite number of pairs of solutions or none (your two lines would be parallel) – Henry Aug 15 '22 at 09:39
  • 1
    There's no point arguing, Card, when you can just do the calculations. $ax+by=r$ gives $y=(r-ax)/b$ (assuming $b\ne0$). Substitute into $cx+dy=s$ to get $cx+(r-ax)d/b=s$, which is $bcx+rd-adx=bs$, so $x=(bs-rd)/(bc-ad)$. If instead we start with $cx+dy=s$, we get $y=(s-cx)/d$ (assuming $d\ne0$), plugging into $ax+by=r$ gives $ax+(s-cx)b/d=r$, which is $adx+bs-bcx=dr$, which gives $x=(dr-bs)/(ad-bc)$. So we get the same $x$ no matter which equation we start with, no matter what $a,b,c,d$ are (so long as we don't divide by zero, a special case which I leave to you to work through). – Gerry Myerson Aug 15 '22 at 09:46
  • 1
    Did my last comment clear things up, Card? – Gerry Myerson Aug 16 '22 at 13:41
  • 1
    @GerryMyerson Yes, I believe so. Thank you very much. – Cardinality Aug 17 '22 at 01:53

0 Answers0