# Solving a complex equation $Ax=b$ with $A,b\in\mathbb C$ using linear algebra

Consider the following very simple linear system with one unknown:

$$$$\label{a}\tag{1} Ax=b \\ \left ( 3+4i \right )x=(6+8i).$$$$

This paper ("On the numerical solving of complex linear systems") says that I can solve the linear system by transforming A to matrix form and then solving it as follows:

$$$$\label{b}\tag{2} \begin{pmatrix} 3 & -4\\ 4 & 3 \end{pmatrix} \binom{x_r}{x_c} = \binom{b_r}{b_c},$$$$ where $$b_r = 6,b_c=8$$.

Question: The translation of the A is fairly easy to understand. What I don't get is why b is not converted to matrix form yet solving the above system yields the correct answer. In other words, the following equations

$$$$\label{c}\tag{3} \left\{\begin{matrix} 3x_r-4x_c = 6\\ 4x_r+3x_c = 8 \end{matrix}\right.$$$$ makes no sense to me.

Note that, I know how to solve the linear system. I'm looking for a detailed explanation of what's happening between (1) and (2)

Thank you

Let's try to justify the equations given by (3). If we write out the product $$(3+4i)x$$, we have $$(3+4i)x = (3 + 4i)(x_r + x_ci) = 3x_r + 3x_c i + 4x_r i + 4x_c i^2 \\ = [3x_r - 4x_c] + [4x_r + 3x_c]i$$ Now, in order for two complex numbers to be equal, their real parts must be equal and their imaginary parts must be equal. So, in order to have $$(3+4i)x = b$$, we must have $$3x_r - 4x_c = b_r\\ 4x_r + 3x_c = b_c$$ which is precisely the system of equations that you've come up with.

• Does your answer imply that if A and b are complex numbers then x must be element of the complex numbers? I'm sorry if this is obvious, my algebra is really dusty Oct 13, 2018 at 20:34
• Yes, my answer does imply this. Just as $\frac ab$ is a real number for any real $a,b$ with $b \neq 0$, so is $\frac AB$ a complex number for any complex numbers $A,B$ with $B \neq 0 + 0i$. Oct 13, 2018 at 20:37

Strictly speaking they should be converted to matrix form and you would solve a block-matrix equation system.

$$\begin{bmatrix}3&-4\\4&3\end{bmatrix}\begin{bmatrix}x_r&-x_c\\x_c&x_r\end{bmatrix}=\begin{bmatrix}b_r&-b_c\\b_c&b_r\end{bmatrix}$$

It just happens that this will be the same thing for this example. For more advanced fields of numbers we will need to resort to this block-matrix embedding.

As an example where the simplified version will fail we can take a look at permutations. A permutation among three different elements can be represented with binary matrices:

$$P_1 = \left[\begin{array}{ccc}0&1&0\\0&0&1\\1&0&0\end{array}\right], P_2 = \left[\begin{array}{ccc}0&1&0\\1&0&0\\0&0&1\end{array}\right]$$ Now let us say that if we apply $$P_1$$ to some permutation and it becomes $$P_2$$, then what was the original permutation?

This we can express as: $$P_1X = P_2$$

Here we need $$X$$ to be a 3x3 matrix, because there is no other way to represent it.

The answer is: $$X=P_1 ^{-1}P_2$$

• Why "should" the system of equations be solved in this particular way? Oct 13, 2018 at 20:30
• @Omnomnomnom Imagine the more general case where "scalars" are permutations, we would not be able to represent a generic permutation with anything less than a matrix of same size. Oct 13, 2018 at 20:41

$$x=x_r+ix_i$$. When we multiply with $$3+4i$$ we get $$3x_r+3ix_i+4ix_r-4x_i=6+8i$$. We now equate the real and imaginary parts separately:$$3x_r-4x_i=6\\3x_i+4x_r=8$$

You want to solve $$az=b$$ for $$a,b\in\mathbb C$$, using the machinery of linear algebra.

Denote real and imaginary parts of the quantities as $$z=x+iy$$ and $$a=a_R + i a_I, b= b_R+i b_I$$. The equation is then equivalent to the following system of real equations: $$\begin{cases} a_R x - a_I y = b_R, \\ a_R y + a_I x = b_I, \end{cases}$$ which can be written in matrix form as $$\underbrace{\begin{pmatrix} a_R & -a_I \\ a_I & a_R \end{pmatrix}}_{\equiv A} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} b_R \\ b_I \end{pmatrix}.$$ Note that the determinant of the matrix $$A$$ equals $$|a|^2$$, which is consistent with $$az=b$$ having nontrivial solutions iff $$a\neq0$$.

Assuming $$|a|^2\neq0$$, we can invert $$A$$ obtaining $$\begin{pmatrix} x \\ y \end{pmatrix} = \frac{1}{|a|^2}\begin{pmatrix} a_R & a_I \\ - a_I & a_R \end{pmatrix} \begin{pmatrix} b_R \\ b_I \end{pmatrix},$$ which translated back into a linear system is $$\begin{cases} |a|^2 x = a_R b_R + a_I b_I, \\ |a|^2 y = -a_I b_R + a_R b_I, \end{cases}$$ or summing the first equation to the second times $$i$$, gives $$z\equiv x+iy = \frac{1}{|a|^2}[(a_R b_R + a_I b_I) + i (-a_I b_R+a_R b_I)].$$ To see that this is consistent with the solution we get via complex analysis, $$z=b/a$$, write the latter as $$z=ba^*/|a|^2$$, and verify that the two expressions are equal.