Question: Given two matrices $A\_{m\times n}$ and $B\_{n\times p}$, what is the sufficient and necessary condition for $AB$ to have full rank?

I know $r(AB)=r(B)-\dim N(A) \cap R(B)$, so is it true the above iff $\dim N(A)\cap R(B)=0$? But seems incorrect if $m\lt p$. Please help.

Answer: 
There are many great answers here, but I just wanted to chime in with my favorite example of how things can go awry if one forgets about the constant of integration.

Consider 
$$\int \sin(2x) dx.$$
We will find antiderivatives in two ways. First, a substitution $u=2x$ yields:
$$\int \frac{\sin(u)}{2}du = -\frac{\cos(u)}{2} = -\frac{\cos(2x)}{2}.$$
Second, we use the identity $\sin(2x)=2\sin(x)\cos(x)$ and a substitution $v=\sin(x)$:
$$\int \sin(2x)dx = \int 2\sin(x)\cos(x)dx = \int 2vdv =v^2 = \sin^2(x).$$
Thus, we have found two antiderivatives of $\sin(2x)$ that are completely different! Namely
$$F(x)=\sin^2(x) \quad \text{and} \quad G(x)=-\frac{\cos(2x)}{2}.$$
Notice that $F(x)=\sin^2(x)\neq -\cos(2x)/2=G(x)$. For instance, $F(0)=\sin^2(0) = 0$ but $G(0)=-\cos(2\cdot 0)/2=-1/2$. So, what happened?

We forgot about the constant of integration, that's what happened. The theory of integration tells us that all antiderivatives differ by a constant. So, if $F(x)$ is an antiderivative, then any other antiderivative $G(x)$ can be expressed as $G(x)=F(x)+C$ for some constant $C$. In particular, our antiderivatives above must differ by a constant. Indeed, the constant $C$ in this case is exactly $C=-\frac{1}{2}$:
$$F(x)+C = F(x) - \frac{1}{2} = \sin^2(x)-\frac{1}{2} = \frac{(1-\cos(2x))}{2}-\frac{1}{2} = -\frac{\cos(2x)}{2} = G(x),$$
where we have used the trigonometric identity $\sin^2(x) = (1-\cos(2x))/2.$
Say every month you earned 10 dollars on a principal of 1000 dollars and put it aside. What have you got after 10 months ?

Not always 100 dollars or 180 dollars or 130. That is so, only if the box contained nothing not at start.

If it contained 35 dollars at start, that is the constant added to the accumulated (integrated) amount $A:$

$ A = m.10 + c = m.10 + 35 $ dollars or 135 or 235 dollars..

The same applies to more complicated integrals. It is also the *initial value* in integration of a variable function with initial value prescribed to evaluate boundary value differential equations.