Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an equation set Ax=b and A(n*m),n<m . To lower down the dimension, I express some vars by other vars, which gives By=c. After some calculation, the values of y is achieved and I want to get x back. How can I accomplish this work?

The main aim is to get the substitution and back substitution, instead of solving the equations.

Remark: n and m are not fixed, the code need to be general for different scales.

For example:


Then we have:


And after some calculation, I get {x[3],x[4]}=={0,1} and I want to get:


I know it's silly to use x[i], as I can't handle matrices well. I believe there is a way to finish all these in the language of matrices.

share|improve this question
Can you clarify a bit more please? First, there are syntax errors/ambiguities (using [] when I think you mean [[]], and = when you mean ==) and your example looks like a system of two equations with four unknowns. – bobthechemist Feb 17 '14 at 10:46
@bobthechemist actually,x[i] can be used as variables, you can think of this as x_i, but x_i means something else in MMA. Here I'm not trying to solve the equations, I'd like to have a method to do the substitution and back substitution. And a method using pure matrices instead of a lot of x[i] would be better. – Jason Feb 17 '14 at 11:07
Solve seems to be what you're after. Or perhaps LinearSolve[A, b] plus NullSpace[A] – Michael E2 Feb 17 '14 at 11:14
ReplaceAll with a certain set of rules comes to mind ... – Yves Klett Feb 17 '14 at 12:23
As $n<m$, $\boldsymbol{\mathrm A}\cdot \boldsymbol{x}=\boldsymbol{b}$ is an underdetermined system, Solve should have no problem to handle it. – Silvia Feb 17 '14 at 14:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.