Given the matrix \[B = \begin{pmatrix} 4-x & -4 & -4 \\ 2 & -2-x & -4 \\ 3 & -3 & -4-x \\ \end{pmatrix}\] , find all values of x that are solutions of det(B) = 0.
The determinant equals to
(4-x)((-2-x)(-4-x) - (-3)(-4)) + (-4)(2(-4-x) - 3(-4)) + (-4)(2(-3) - 3*(-2-x)) = 0
(4-x)((-2-x)(-4-x) - 12) + (-4)(-8 - 2x + 12) + (-4)(-6 - 3(-2-x)) = 0
(4-x)(8 + 2x + 4x + x^2 - 12) + 32 + 8x - 48 + (-4)(-6 + 6 + 3x)) = 0
(4-x)(8 + 6x + x^2 - 12) + 32 + 8x - 48 - 12x = 0
(4-x)(6x + x^2 - 4) - 16 - 4x = 0
24x + 4x^2 + 16 - 6x^2 - x^3 + 4x - 16 - 4x = 0
-x^3 - 2x^2 + 8x = 0
-x(x^2 + 2x - 8) = 0
-x(x-2)(x+4)=0
x1=0, x2=2, x3=-4
Now, let’s test the solution with x1,x2 and x3.
x <- 0
B = matrix(
c(4-x,2,3,-4,-2-x,-3,-4,-4,-4-x),
nrow=3,
ncol=3,
byrow = TRUE)
det(B)
## [1] 0
x <- 2
B = matrix(
c(4-x,2,3,-4,-2-x,-3,-4,-4,-4-x),
nrow=3,
ncol=3,
byrow = TRUE)
det(B)
## [1] 0
x <- -4
B = matrix(
c(4-x,2,3,-4,-2-x,-3,-4,-4,-4-x),
nrow=3,
ncol=3,
byrow = TRUE)
det(B)
## [1] 0