[Math] 2×2 inverse of a complex matrix with complex determinant

complex numbersinversematrices

Firstly, my question may be related to a similar question here: Are complex determinants for matrices possible and if so, how can they be interpreted?

I am using:
$$
\left(\begin{array}{cc}
a&b\\
c&d
\end{array}\right)^{-1}
=
{1 \over a d – b c}
\left(\begin{array}{rr}
d&-b\\
-c&a
\end{array}\right)~,~~\text{ where } ad-bc \ne 0.
$$
which is a very well known way to calculate the inverse of a 2×2 matrix. My problem interpreting what the significance of a complex determinant (i.e. the denominator on the right hand side of the '='). I've always assumed you'd take the magnitude of the complex dterminant in this case?

The reason why I am asking is I am writing a function in the C programming language which should be able to take real (imaginary part = 0) and complex values of $a, b, c$ and $d$.

If I was to take the magnitude of the complex number in the denominator this isn't a problem, but for cases where the real part of determinant turns out to be negative and the imaginary part is equal to zero, would it be correct to take the magnitude in this case as it would lead to a sign change in in the elements of the inverse matrix?

Eg.
Determinant $ = -2 +j0$, so:
$abs(-2 + j0) = 2$, which would change the signs of the elements of my inverse matrix. However, if I was to work this out with a paper and pen, I simply treat my "complex" determinant as a real number and I don't bother taking the magnitude or the absolute value, thus maintaining the '-' in the real part (determinant $=-2$).

Many thanks

EDIT:
Say determinant =$z$
So, $z^{-1} = r^{-1}(cos \theta + j sin \theta) ^{-1}$, where $r = |z|$ and $\theta = angle(z)$.
If $z_{imag} = 0$, then:
$$
z^{-1} = r^{-1} cos\theta
$$

$$
z^{-1} =1/r = 1/|z|
$$
The line above is obviously not correct and is the source of my confusion!

Best Answer

There is no justification for taking the magnitude of the determinant. Instead, just use the formula as you stated above, while ensuring that you properly add, multiply and divide the complex quantities.

The only scenario in which the inverse would not exist is if the determinant was zero, but if it is anything else (complex or negative), the formula for the inverse is correct.

Related Question