# Solving Symbolically Equations with Vectors and Matrices [closed]

I want to solve equations with vector variables and vector/matrix parameters symbolically.

As a basic example I would like to be able to solve something like $[I-aG]x=b$ where $a,b \in \mathbb{R}^l$ are parameters, $x \in \mathbb{R}^l$ is the variable to be solved for, and $I$ and $G$ are $l \times l$ matrices. Namely, I would simply like Mathematica to output: $x=[I-aG]^{-1}b$.

Ultimately I would like to be able to solve symbolic systems of two linear simultaneous equations in two unknowns $x$ and $y$ such as \begin{align} Ax + By & = a \\ Cx + Dy & = b, \end{align} where all the capital objects are $l \times l$ matrices and all the lower case objects are vectors in $\mathbb{R}^l$. In this case I would like Mathematica to output something like (if my algebra is right): \begin{align} x & = (A-BD^{-1}C)^{-1}a - A^{-1}B(D-CA^{-1}B)^{-1}b \\ y & = -D^{-1}C(A-BD^{-1}C)^{-1}a + (D-CA^{-1}B)^{-1} b. \end{align}

I have been looking around here and could not really find anything addressing plain and simple algebraic manipulation of vectors and matrices. Really, the only things that differs from manipulating scalars is making sure to get the commutativity rules right, understand transposes, and write inverses rather than divisions. Is what I am talking about possible to do in Mathematica? Thank you!

## closed as unclear what you're asking by user9660, MarcoB, m_goldberg, Öskå, JensJun 8 '16 at 6:08

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Have you written any code you would like to share ? – Sektor Feb 13 '15 at 21:58
• Not really, sorry. I just could not find any way of telling Mathematica "these objects are matrices and these are vectors" and then use the Solve command. All I have are solutions to systems of equations with scalars, with which I have no issues. – Matteo Feb 13 '15 at 22:03
• This will get you started. – Sektor Feb 13 '15 at 22:16
• Thank you for the link. To my understanding, however, the 'Solving Linear Systems' documentation page addresses the problem of solving linear systems with scalar objects by turning them into matrix form. This is a different problem to the one I am faced with. I am trying to manipulate algebraically equations whose elements are multidimensional to obtain a closed form symbolic expression of the solution. – Matteo Feb 13 '15 at 23:04
• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey Feb 14 '15 at 4:45