Hallar X en una ecuación matricial e inversa matriz 3x3 por determinantes

El ejercicio a realizar en esta entrega consiste en determinar el valor de un parámetro para que una matriz tenga inversa y en resolver una ecuación matricial. El fichero LyX/pythontex que se puede descargar al final del artículo permite obtener diferentes ejercicios a partir de un modelo tipo en el cual la mayoría de los datos se obtienen de forma aleatoria.

En la resolución de los ejercicios se explicitan casi todos los cálculos: cálculo de de los determinantes, multiplicación de matrices … Además, las inversas de las matrices se obtienen usando determinantes.

Lo único que tendremos que adecuar en el fichero es:

# VALORES QUE SE PUEDEN MODIFICAR
# Valores para obtener los datos aleatorios
# Para las matrices A y C, entre ambos valores
vm = -3
vM = 3
# Valor de m para el apartado 2, provoca cambiar la matriz A(m)
valorm = 2

"""
OPCIONES PERMITIDAS
1 -> El det(A) = +-1
2 -> Det(A) != 0 => pueden aparecer fracciones
"""
# Si no es igual a 1 siempre es la opción 2
opción = 2

La salida del programa discrimina si el determinante de la matriz AA vale ±1\pm1 o no, en este segundo caso (aparecen fraccciones en el cálculo de la inversa) se adecúa la salida para que el uso de fracciones sea mínimo.

Un ejemplo de ejercicio generado a partir de los valores anteriores se muestra a continuación:

Un poco de teoría

Dada una matriz cuadrada A=(a0,0a0,1a0,2a1,0a1,1a1,2a2,0a2,1a2,2)A=\begin{pmatrix}{a}_{0,0} & {a}_{0,1} & {a}_{0,2}\\ {a}_{1,0} & {a}_{1,1} & {a}_{1,2}\\ {a}_{2,0} & {a}_{2,1} & {a}_{2,2} \end{pmatrix}, la matriz adjunta da AA es otra matriz que resulta de sustituir cada elemento por su adjunto.

Adj(A)=(+a1,1a1,2a2,1a2,2-a1,0a1,2a2,0a2,2+a1,0a1,1a2,0a2,1-a0,1a0,2a2,1a2,2+a0,0a0,2a2,0a2,2-a0,0a0,1a2,0a2,1+a0,1a0,2a1,1a1,2-a0,0a0,2a1,0a1,2+a0,0a0,1a1,0a1,1)\mathtt{\text{Adj(A)=}}\left(\begin{matrix}\mathtt{\text{+}}\begin{vmatrix}{a}_{1,1} & {a}_{1,2}\\ {a}_{2,1} & {a}_{2,2} \end{vmatrix} & \mathtt{\text{-}}\begin{vmatrix}{a}_{1,0} & {a}_{1,2}\\ {a}_{2,0} & {a}_{2,2} \end{vmatrix} & \mathtt{\text{+}}\begin{vmatrix}{a}_{1,0} & {a}_{1,1}\\ {a}_{2,0} & {a}_{2,1} \end{vmatrix}\\ \mathtt{\text{-}}\begin{vmatrix}{a}_{0,1} & {a}_{0,2}\\ {a}_{2,1} & {a}_{2,2} \end{vmatrix} & \mathtt{\text{+}}\begin{vmatrix}{a}_{0,0} & {a}_{0,2}\\ {a}_{2,0} & {a}_{2,2} \end{vmatrix} & \mathtt{\text{-}}\begin{vmatrix}{a}_{0,0} & {a}_{0,1}\\ {a}_{2,0} & {a}_{2,1} \end{vmatrix}\\ \mathtt{\text{+}}\begin{vmatrix}{a}_{0,1} & {a}_{0,2}\\ {a}_{1,1} & {a}_{1,2} \end{vmatrix} & \mathtt{\text{-}}\begin{vmatrix}{a}_{0,0} & {a}_{0,2}\\ {a}_{1,0} & {a}_{1,2} \end{vmatrix} & \mathtt{\text{+}}\begin{vmatrix}{a}_{0,0} & {a}_{0,1}\\ {a}_{1,0} & {a}_{1,1} \end{vmatrix} \end{matrix}\right)

Si A0A1=(Adj(A))AT=Adj(AT)A|A|\neq0\Rightarrow A^{-1}=\dfrac{\left(Adj(A)\right)}{|A|}^{T}=\dfrac{Adj(A^{T})}{|A|}

Ejercicio

  1. Dada la matriz A=(1333m533m1m+1)A=\begin{pmatrix}1 & 3 & 3\\ 3 & m-5 & -3\\ -3 & m-1 & m+1 \end{pmatrix} determina el valor de mm para el que la matriz AA no tiene inversa.
  2. Para m=2m=2 resuelve la ecuación AXB=CTAXB=C^{T} siendo B=(0110)B=\begin{pmatrix}0 & -1\\ -1 & 0 \end{pmatrix} y C=(131013)C=\begin{pmatrix}1 & 3 & 1\\ 0 & 1 & 3 \end{pmatrix}

Solución

  1. Calculemos

    A=1333m533m1m+1=\left|A\right|=\begin{vmatrix}1 & 3 & 3\\ 3 & m-5 & -3\\ -3 & m-1 & m+1 \end{vmatrix}= 1333m533m1m+11333m53\begin{array}{c} \begin{vmatrix}1 & 3 & 3\\ 3 & m-5 & -3\\ -3 & m-1 & m+1 \end{vmatrix}\\ \textcolor{cyan}{\begin{array}{ccc} 1 & 3 & 3\\ 3 & m-5 & -3 \end{array}} \end{array}

    =[1(m5)(m+1)+3(m1)3+(3)3(3)]=\left[1\left(m-5\right)\left(m+1\right)+3\left(m-1\right)3+\left(-3\right)3\left(-3\right)\right]-[3(m5)(3)+(3)(m1)1+(m+1)33]\left[3\left(m-5\right)\left(-3\right)+\left(-3\right)\left(m-1\right)1+\left(m+1\right)3\cdot3\right]=(m2+5m+13)(573m)=m2+8m44=\left(m^{2}+5m+13\right)-\left(57-3m\right)=m^{2}+8m-44

    por tanto A=0m2+8m44=0|A|=0\Leftrightarrow m^{2}+8m-44=0\Leftrightarrow

    m=b±b24ac2am=\dfrac{-b\pm\sqrt{b^{2}-4ac}}{2a} == 8±(8)24(1)(44)2(1)\dfrac{-8\pm\sqrt{(8)^{2}-4\cdot(1)\cdot(-44)}}{2\cdot(1)} == 8±2402\dfrac{-8\pm\sqrt{240}}{2} == 8±4152\dfrac{-8\pm{4\sqrt{15}}}{2} \Rightarrow m={4+2152154m=\left\{ \begin{array}{c} -4+2\sqrt{15}\\ -2\sqrt{15}-4 \end{array}\right.

    obtenemos que si m={(4+215,),(2154,)}m=\left\{ \left(-4+2\sqrt{15},\right),\left(-2\sqrt{15}-4,\right)\right\} la matriz AA no tiene inversa.

  2. AXB=CTX=A1CTB1AXB=C^{T}\Leftrightarrow X=A^{-1}C^{T}B^{-1} en consecuencia tenemos que ver que existen y hallar A1A^{-1}y B1B^{-1}

    Para m=2m=2 la matriz A=(133333313)A=\begin{pmatrix}1 & 3 & 3\\ 3 & -3 & -3\\ -3 & 1 & 3 \end{pmatrix} y por lo que hemos obtenido anteriormente sabemos que tiene inversa. Además, podemos calcular su determinante de dos formas:

    1. Sustituyendo m=2m=2 en el determinante obtenido en el apartado anterior (m2+8m44m^{2}+8m-44) y obtenemos que A=24|A|=-24

    2. A=133333313=\left|A\right|=\begin{vmatrix}1 & 3 & 3\\ 3 & -3 & -3\\ -3 & 1 & 3 \end{vmatrix}= 133333313133333\begin{array}{c} \begin{vmatrix}1 & 3 & 3\\ 3 & -3 & -3\\ -3 & 1 & 3 \end{vmatrix}\\ \textcolor{cyan}{\begin{array}{ccc} 1 & 3 & 3\\ 3 & -3 & -3 \end{array}} \end{array}

      =[1(3)3+313+(3)3(3)]=\left[1\left(-3\right)3+3\cdot1\cdot3+\left(-3\right)3\left(-3\right)\right]-[3(3)(3)+(3)11+333]\left[3\left(-3\right)\left(-3\right)+\left(-3\right)1\cdot1+3\cdot3\cdot3\right]=(27)(51)=24=\left(27\right)-\left(51\right)=-24

    La adjunta de la matriz AA es

    Adj(A) =(+3313-3333+3331-3313+1333-1331+3333-1333+1333)\mathtt{\text{Adj(A) =}}\left(\begin{matrix}\mathtt{\text{+}}\begin{vmatrix}-3 & -3\\ 1 & 3 \end{vmatrix} & \mathtt{\text{-}}\begin{vmatrix}3 & -3\\ -3 & 3 \end{vmatrix} & \mathtt{\text{+}}\begin{vmatrix}3 & -3\\ -3 & 1 \end{vmatrix}\\ \mathtt{\text{-}}\begin{vmatrix}3 & 3\\ 1 & 3 \end{vmatrix} & \mathtt{\text{+}}\begin{vmatrix}1 & 3\\ -3 & 3 \end{vmatrix} & \mathtt{\text{-}}\begin{vmatrix}1 & 3\\ -3 & 1 \end{vmatrix}\\ \mathtt{\text{+}}\begin{vmatrix}3 & 3\\ -3 & -3 \end{vmatrix} & \mathtt{\text{-}}\begin{vmatrix}1 & 3\\ 3 & -3 \end{vmatrix} & \mathtt{\text{+}}\begin{vmatrix}1 & 3\\ 3 & -3 \end{vmatrix} \end{matrix}\right)

    =(6066121001212)=\begin{pmatrix}-6 & 0 & -6\\ -6 & 12 & -10\\ 0 & 12 & -12 \end{pmatrix}\Rightarrow

    (Adj(A))T=(6600121261012)A1=124(6600121261012)=\left(Adj(A)\right)^{T}=\begin{pmatrix}-6 & -6 & 0\\ 0 & 12 & 12\\ -6 & -10 & -12 \end{pmatrix}\Rightarrow A^{-1}=\dfrac{1}{-24}\cdot\begin{pmatrix}-6 & -6 & 0\\ 0 & 12 & 12\\ -6 & -10 & -12 \end{pmatrix}=(14140012121451212)\left(\begin{matrix}\frac{1}{4} & \frac{1}{4} & 0\\ 0 & -\frac{1}{2} & -\frac{1}{2}\\ \frac{1}{4} & \frac{5}{12} & \frac{1}{2} \end{matrix}\right)

    B=0110=\left|B\right|=\begin{vmatrix}0 & -1\\ -1 & 0 \end{vmatrix}=

    =[02]=\left[0^{2}\right]-[(1)2]\left[\left(-1\right)^{2}\right]=(0)(1)=1=\left(0\right)-\left(1\right)=-1

    Adj(B)=(0110)Adj(B)=\begin{pmatrix}0 & 1\\ 1 & 0 \end{pmatrix}\Rightarrow

    (Adj(B))T=(0110)B1=11(0110)=(0110)\left(Adj(B)\right)^{T}=\begin{pmatrix}0 & 1\\ 1 & 0 \end{pmatrix}\Rightarrow B^{-1}=\dfrac{1}{-1}\cdot\begin{pmatrix}0 & 1\\ 1 & 0 \end{pmatrix}=\begin{pmatrix}0 & -1\\ -1 & 0 \end{pmatrix}

    Por último CT=(103113)C^{T}=\begin{pmatrix}1 & 0\\ 3 & 1\\ 1 & 3 \end{pmatrix}

    En consecuencia X=(124)(6600121261012)(103113)(0110)X=\left(-\frac{1}{24}\right)\begin{pmatrix}-6 & -6 & 0\\ 0 & 12 & 12\\ -6 & -10 & -12 \end{pmatrix}\cdot\begin{pmatrix}1 & 0\\ 3 & 1\\ 1 & 3 \end{pmatrix}\cdot\begin{pmatrix}0 & -1\\ -1 & 0 \end{pmatrix}

    (6600121261012)(103113)=\left(\begin{matrix}-6 & -6 & 0\\ 0 & 12 & 12\\ -6 & -10 & -12 \end{matrix}\right)\cdot\left(\begin{matrix}1 & 0\\ 3 & 1\\ 1 & 3 \end{matrix}\right)=

    =((6)1+(6)3+01(6)0+(6)1+0301+123+12102+121+123(6)1+(10)3+(12)1(6)0+(10)1+(12)3)\mathtt{\text{=}}\left(\begin{matrix}\left(-6\right)1\mathtt{\text{+}}\left(-6\right)3\mathtt{\text{+}}0\cdot1 & \left(-6\right)0\mathtt{\text{+}}\left(-6\right)1\mathtt{\text{+}}0\cdot3\\ 0\cdot1\mathtt{\text{+}}12\cdot3\mathtt{\text{+}}12\cdot1 & 0^{2}\mathtt{\text{+}}12\cdot1\mathtt{\text{+}}12\cdot3\\ \left(-6\right)1\mathtt{\text{+}}\left(-10\right)3\mathtt{\text{+}}\left(-12\right)1 & \left(-6\right)0\mathtt{\text{+}}\left(-10\right)1\mathtt{\text{+}}\left(-12\right)3 \end{matrix}\right)

    =(24648484846)=\left(\begin{matrix}-24 & -6\\ 48 & 48\\ -48 & -46 \end{matrix}\right)

    (24648484846)(0110)=\left(\begin{matrix}-24 & -6\\ 48 & 48\\ -48 & -46 \end{matrix}\right)\cdot\left(\begin{matrix}0 & -1\\ -1 & 0 \end{matrix}\right)=

    =((24)0+(6)(1)(24)(1)+(6)0480+48(1)48(1)+480(48)0+(46)(1)(48)(1)+(46)0)\mathtt{\text{=}}\left(\begin{matrix}\left(-24\right)0\mathtt{\text{+}}\left(-6\right)\left(-1\right) & \left(-24\right)\left(-1\right)\mathtt{\text{+}}\left(-6\right)0\\ 48\cdot0\mathtt{\text{+}}48\left(-1\right) & 48\left(-1\right)\mathtt{\text{+}}48\cdot0\\ \left(-48\right)0\mathtt{\text{+}}\left(-46\right)\left(-1\right) & \left(-48\right)\left(-1\right)\mathtt{\text{+}}\left(-46\right)0 \end{matrix}\right)

    =(62448484648)=\left(\begin{matrix}6 & 24\\ -48 & -48\\ 46 & 48 \end{matrix}\right)\Rightarrow

    X=124(62448484648)=(1412223122)X=-\frac{1}{24}\left(\begin{matrix}6 & 24\\ -48 & -48\\ 46 & 48 \end{matrix}\right)=\left(\begin{matrix}-\frac{1}{4} & -1\\ 2 & 2\\ -\frac{23}{12} & -2 \end{matrix}\right)

Enlaces al fichero fuente y al pdf final de una posible compilación.