Linear equations given by $Ax = b$ have a solution if and only if $\operatorname{rank}(A|b) = \operatorname{rank}(A)$

To see this note that rank of the matrix is dimension of the span of columns of the matrix. Now if $Ax=b$ has solution, then it means that some linear combination of columns of A gives us b, which implies that $b$ lies in $span(A)$ and so $rank(A|b)=rank(A)$. You can argue similarly in the reverse direction.


To get started,

If the system contains a row such that [ 0 0 0 0 | b ] with b=/=0 then the system is inconsistent and has no solution. The rank is the number of pivots matrix X has in echelon form, whereby b is the pivot in this row.

Let M=[A ,B], the augmented matrix, where A is the original matrix.

The system has a solution if and only if rank(A)=rank(M).

If b is a pivot of M then the solution does not exist. Hence rank(m)>rank(a).