In Matsumura textbook to show that $\dim A[x] = \dim A + 1$, first it states that $A[x] \otimes k(\mathfrak{p}) = k(\mathfrak{p})[x]$ which is one dimensional. Then it uses the theorem 15.1.(ii) since $A[x]$ is a free $A$-module that $\mathrm{dim}(A[x]) = \mathrm{dim}(A) + 1$.
My doubt is : Theorem 15.1.(ii) states that if a ring homomorphism $\phi: A \to B$ is flat then $\mathrm{ht}(P) = \mathrm{ht}(\mathfrak{p}) + \mathrm{dim}(B_P/\mathfrak{p} B_P)$, where $P$ is a prime ideal in $B$ and $\mathfrak{p} = \phi^{-1}(P)$.
Does that mean to prove the above result the textbook used the idea that $A[x] \otimes k(\mathfrak{p}) = A[x]_P/\mathfrak{p} A[x]_P$? But this is not true in general. What am I missing?