# Find the NullSpace of a matrix whose determinant is "almost" zero

If $A$ is a matrix such that $\det(A)=0$, it is easy to get a basis of the kernel of $A$ with NullSpace[A].

Now let's consider a matrix $B$, function of a parameter p. Suppose there exists a $p_0$ such that $\det(B(p_0))=0$ but that in Mathematica, the p0 can only be estimated numerically and I get Det[B[p0]] equals to something small such as $10^{-10}$. Mathematically, B[p0] is invertible... and so NullSpace[B[p0]] yields the empty set.

Question: How could I find the kernel of $B(p_0)$?

• Use the Tolerance option of NullSpace. Oct 8 '14 at 21:02
• @DanielLichtblau TY for you efficient answer. I integrated it in the answer and then accepted it. Oct 8 '14 at 21:38

The magical words are Singular Value Decomposition. The singular vectors corresponding to small singular values form the kernel. Of course, Singular Value Decomposition is available in Mathematica as SingularValueDecomposition[]. As confirmed by Daniel Lichtblau, the built-in Tolerance option to NullSpace[] does it this exact way.
• @anderstood I am sure that is what Mathematica is doing with the Tolerance option. Oct 8 '14 at 21:31
• Correct. NullSpace uses SVD under the hood. Oct 8 '14 at 22:03