How can I solve a linear system of equations and get the general solution? Let $A$ be $m \times n$ and $b \in C(A)$. How do I get the general solution of $Ax=b$?
Example:
Let $A= \begin{bmatrix}1&0\\0&0 \end{bmatrix}$ and $b = \begin{bmatrix}1\\0 \end{bmatrix}$. The general solution of $Ax=b$ is $x=\begin{bmatrix}1\\0 \end{bmatrix} + t \begin{bmatrix}0\\1 \end{bmatrix}$.
If I use LinearSolve
I only get the particular solution {1,0}
.
A = {{1, 0}, {0, 0}}; b = {1, 0}; LinearSolve[A, b] // MatrixForm
This seems like a basic thing to do, solving linear systems of equations. Yet I searched Google and the forum and I didn't find a general answer to this problem. I read the documentation on LinearSolve
and it says it gives only one solution. Is there no function in Mathematica that gives the general solution?
xx = Array[x,2];Solve[A.xx==b,xx]
$\endgroup$