Solving a matrix equation with varying matrices

51 Views Asked by At

Having $3\times 3$ matrices $A_1$ and $A_2$, and vectors $b_1$ and $b_2$ in $R^3$, how can I find real coefficient $\lambda$ and vector $x$ so that:

$(A_1 - \lambda A_2) x + b_1 - \lambda b_2$ = 0

2

There are 2 best solutions below

0
On

The equation can be written as

$$(A_1 - \lambda A_2) x = -b_1 + \lambda b_2$$

which for any given $\lambda$ you can solve in the usual way to get $x$ (which will depend on $\lambda$: for each $\lambda$ there may be no solutions, a unique solution or multiple solutions).

0
On

This is an inhomogeneous linear system: $$ (A_1 - \lambda A_2) x = -(b_1 - \lambda b_2) \iff \\ A x = b $$ The challenge here is to look at the $A_i$ and $b_i$ and come up with a $\lambda$ for which a solution exists.

Some easy cases:

  1. $b = 0 \iff b_1 = \lambda b_2$, then $x = 0$ and that $\lambda$ will do.
  2. $\det(A_1) \ne 0$, then $x = -A_1^{-1} b_1$ and $\lambda = 0$ are a solution.

Otherwise we can assume $\det(A_1) = 0$, then $$ \det(A) = \det(A_1 - \lambda A_2) = c_3 \lambda^3 + c_2 \lambda^2 + c_1 \lambda + c_0 = P(\lambda) $$ where the $c_i$ depend on the elements of $A_1$ and $A_2$ and can be obtained by some lengthy algebraic calculation (see the appendix).

For $\lambda = 0$ we have $c_0 = \det(A) = \det(A_1)$, which for this case gives $c_0 = 0$ and we get $$ P(\lambda) = (c_3 \lambda^2 + c_2 \lambda + c_1)\lambda $$ $c_3$ is $-\det(A_2)$, but I have no proof for this, except the calculation in the appendix.

  1. If $c_3 \ne 0$ we know $P(\lambda)$ is a parabola which has no more than two roots, which we might determine and chose a $\lambda^*$ different from them, so $P(\lambda^*) \ne 0$ and we can solve $x = A^{-1} b$ for that one.

  2. If $c_3 = 0$ and $c_2 \ne 0$ then $P(\lambda)$ is a linear function, which has the root $\lambda_0 = -c_1 / c_2$, so we can choose $\lambda^* = \lambda_0 + 1$ for example to get $P(\lambda^*) \ne 0$ and again have $x = A^{-1} b$ for that one.

  3. If $c_3 = c_2 = 0$ and $c_1 \ne 0$ then any $\lambda \ne 0$ will do, so we choose $\lambda^* = 1$ etc.

If $c_3 = c_2 = c_1 = 0$ then $\det(A) = 0$ and we have no unique solution. So we have either infinite many or no solutions. And we need to stick to the usual algebraic manipulations to determine the solutions of $A x = b$.

Appendix:

A calculation with Maxima gives

\begin{align} P(\lambda) &= ( \left(a^2_{12}a^2_{21}-a^2_{11}a^2_{22}\right) a^2_{33}+ \left(a^2_{11}a^2_{23}-a^2_{13}a^2_{21}\right) a^2_{32}+ \left(a^2_{13}a^2_{22}-a^2_{12}a^2_{23}\right) a^2_{31} ) \, \lambda^3 + \\ & ( \left(a^1_{11}a^2_{22}-a^1_{12}a^2_{21}-a^1_{21}a^2_{12}+a^1_{22}a^2_{11}\right) a^2_{33} + \\ &\left(-a^1_{11}a^2_{23}+a^1_{13}a^2_{21}+a^1_{21}a^2_{13}-a^1_{23}a^2_{11}\right) a^2_{32} + \\ &\left(a^1_{12}a^2_{23}-a^1_{13}a^2_{22}-a^1_{22}a^2_{13}+a^1_{23}a^2_{12}\right) a^2_{31} + \\ &\left(a^1_{31}a^2_{12}-a^1_{32}a^2_{11}\right) a^2_{23} + \left(a^1_{33}a^2_{11}-a^1_{31}a^2_{13}\right) a^2_{22} + \left(a^1_{32}a^2_{13}-a^1_{33}a^2_{12}\right) a^2_{21} ) \, \lambda^2 + \\ & ( \left(a^1_{12}a^1_{21}-a^1_{11}a^1_{22}\right) a^2_{33} + \left(a^1_{11}a^1_{23}-a^1_{13}a^1_{21}\right) a^2_{32} + \left(a^1_{13}a^1_{22}-a^1_{12}a^1_{23}\right) a^2_{31} + \\ &\left(a^1_{11}a^1_{32}-a^1_{12}a^1_{31}\right) a^2_{23} + \left(a^1_{13}a^1_{31}-a^1_{11}a^1_{33}\right) a^2_{22} + \left(a^1_{12}a^1_{33}-a^1_{13}a^1_{32}\right) a^2_{21} + \\ &\left(a^1_{22}a^1_{31}-a^1_{21}a^1_{32}\right) a^2_{13} + \left(a^1_{21}a^1_{33}-a^1_{23}a^1_{31}\right) a^2_{12} + \left(a^1_{23}a^1_{32}-a^1_{22}a^1_{33}\right) a^2_{11} ) \lambda + \\ & \left(a^1_{11}a^1_{22}-a^1_{12}a^1_{21}\right) a^1_{33} + \left(a^1_{13}a^1_{21}-a^1_{11}a^1_{23}\right) a^1_{32} + \left(a^1_{12}a^1_{23}-a^1_{13}a^1_{22}\right) a^1_{31} \\ &= - \det(A_2) \, \lambda^3 + \\ & ( \left(a^1_{11}a^2_{22}-a^1_{12}a^2_{21}-a^1_{21}a^2_{12}+a^1_{22}a^2_{11}\right) a^2_{33} + \\ &\left(-a^1_{11}a^2_{23}+a^1_{13}a^2_{21}+a^1_{21}a^2_{13}-a^1_{23}a^2_{11}\right) a^2_{32} + \\ &\left(a^1_{12}a^2_{23}-a^1_{13}a^2_{22}-a^1_{22}a^2_{13}+a^1_{23}a^2_{12}\right) a^2_{31} + \\ &\left(a^1_{31}a^2_{12}-a^1_{32}a^2_{11}\right) a^2_{23} + \left(a^1_{33}a^2_{11}-a^1_{31}a^2_{13}\right) a^2_{22} + \left(a^1_{32}a^2_{13}-a^1_{33}a^2_{12}\right) a^2_{21} ) \, \lambda^2 + \\ & ( \left(a^1_{12}a^1_{21}-a^1_{11}a^1_{22}\right) a^2_{33} + \left(a^1_{11}a^1_{23}-a^1_{13}a^1_{21}\right) a^2_{32} + \left(a^1_{13}a^1_{22}-a^1_{12}a^1_{23}\right) a^2_{31} + \\ &\left(a^1_{11}a^1_{32}-a^1_{12}a^1_{31}\right) a^2_{23} + \left(a^1_{13}a^1_{31}-a^1_{11}a^1_{33}\right) a^2_{22} + \left(a^1_{12}a^1_{33}-a^1_{13}a^1_{32}\right) a^2_{21} + \\ &\left(a^1_{22}a^1_{31}-a^1_{21}a^1_{32}\right) a^2_{13} + \left(a^1_{21}a^1_{33}-a^1_{23}a^1_{31}\right) a^2_{12} + \left(a^1_{23}a^1_{32}-a^1_{22}a^1_{33}\right) a^2_{11} ) \lambda + \\ & \det(A_1) \end{align}