If r< n- that is if the rank is less than the number of rows, you cannot use this because A is not invertible-

does not exist.
Does the book say what

,

,

, and
mean?
You could do this: If A:

does not have an inverse then it maps all of

into a
sub space of

. There is no solution to Ax= B unless B happens to lie in that subspace (in which case there may be an infinite number of solutions). If B is not in the subspace then the best you can do is find x so that Ax is "closest" to B. To do that, drop a perpendicular from B to the subspace. Call vector, the vector in the range of A closest to B, B' and look at B- B'= B- Ax where x is such that Ax= B'. That vector is perpendicular to the subpace: <B- Ax, u>= 0 for all u in the subspace. But every vector in that subspace is of the form u= Av for some v because that subspace
is the range of A, that is the same as <B- Ax, Av>= 0. Now define A~ to be the "adjoint" of A, the linear operator such that <v, Au>= <A*v, u> for all u in

and all v in

(for real matrices this is the transpose).
Then we have <B- Ax, Av>= <A*(B- Ax), v> where this inner product is on

and v can be any vector in

/ In particular, v couls be A*(B- Ax) itself so we must have A*(B- Ax)= A*B- A*Ax= 0 or A*Ax= A*B. Now it
may happen that A*A is invertible even if A itself is not. In that case we have [itex]x= (A*A)^{-1}A*B[/itex], and [itex](A*A)^{-1}A*[/itex] is called the "generalized inverse". If A itself has an inverse, then [itex](A*A)^{-1}= A^{-1}A*^{-1}[/itex] so that [itex](A*A)^{-1}A*= A^{-1}A*^{-1}A*= A^{-1}[/itex] the true inverse.
Note that * throughout means the "adjoint", not multiplication.