# How to obtain the inverse of a matrix while solving an equation?

Given a matrix $A$, let us assume there is a equation: $Ax = b$

To solve for $x$, we can write:

$x = A^{-1} b$

One way to obtain the inverse of A is by single value decomposition:

Decomposition of $A$: $US(V^T)$, where $S$ is a diagonal matrix of singular values.

Therefore:

$Ax=b$

$US(V^T)x=b$

$x=(VW(U^T))b$, where $W=1/S$ along the diagonals.

Is there any other way instead of SVD to find the transpose of $A$.

• If it's invertible, you can augment A with an identity matrix and then put A into row reduced echelon form though Gaussian Elimination applying each operation to the augmented matrix. Once in reduced echelon form, the identity matrix will be the inverse. You can use LU decomposition too. Your question is confusing. Are you trying to find the inverse or the transpose or both? – StatsStudent Apr 7 '16 at 2:23
• And I'm not sure what you mean by "in an equation setting." Finding an inverse of a matrix is no different than finding one "in an equation setting." An inverse in an inverse. – StatsStudent Apr 7 '16 at 2:31
• @Analyst1 I changed the title. Basically, what I am asking is while solving the equation (i.e., obtain x), I need to have the inverse of A. And instead of using single value decomposition, is there any other representation that I can use to solve the equation. – RockTheStar Apr 7 '16 at 2:41
• Why did you change the title then? You have "Is there any other way instead of SVD to find the transpose of A." You can use Gaussian Elimination to do what you are asking. – StatsStudent Apr 7 '16 at 2:45
• You never, never, never want to explicitly calculate an inverse of a matrix. It's slow, and it can go horribly wrong numerically. To solve an equation, use Gaussian Elimination, which is covered in any elementary Linear Algebra textbook. To transpose a matrix, simply exchange elements, or indices - this is just a question of data structures. – Stephan Kolassa Apr 7 '16 at 6:56

I think there are lots of way to solve the linear equation problem based on matrix decomposition. For equation $Ax=b$, there are LU decomposition and QR decomposition as well. For example, when using LU decomposition $X = LU$, you can perform forward substitute with $L$ then backward substitute using $U$. If you want use QR decomposition, $Ax=b$ means $QRx = b$ and get the result as $x = bQ ^ T R ^ {-1}$.