using Symbolics, LinearAlgebra @variables a[1:3, 1:3] A = collect(a) expand(det(A)) @variables a b c d šŸŽ šŸŒ šŸŖ šŸ„Ÿ Ī± Ī² Ī³ Ī“ ā™£ ā™” ā™  ā™¢ A = [a b šŸŽ šŸŒ] det(A) A = [a b c šŸŽ šŸŒ šŸŖ Ī± Ī² Ī³] expand(det(A)) A = [ a b c d šŸŽ šŸŒ šŸŖ šŸ„Ÿ Ī± Ī² Ī³ Ī“ ā™£ ā™” ā™  ā™¢] expand(det(A)) @variables a[1:5,1:5] A = collect(a) expand(det(A)) @variables a # make this back to an ordinary scalar variable A = [1 3 2 4] det(A) A = [1 2 2 4] det(A) A = randn(5,5) det(A) L,U = lu(A, NoPivot()) # LU without row swaps U prod(diag(U)) # the product of the diagonal elements of U Iā‚… = I(5) * 1 det(Iā‚…) det([a b šŸŽ šŸŒ]) det([šŸŽ šŸŒ a b]) Iā‚…_swapped = Iā‚…[ [2,1,3,4,5], : ] det(Iā‚…_swapped) A = rand(-3:3, 5,5) B = A[ [2,1,3,4,5], : ] det(A), det(B) C = copy(A) C[2,:] = 2*A[2,:] C det(A), det(C) det(2A) / det(A) A [1,0,0,0,0] * [1 2 3 4 5] # = column * row = outer product det(A + [1,0,0,0,0] * [1 2 3 4 5]) Aā€² = copy(A) Aā€²[1,:] = [1,2,3,4,5] # replace first row Aā€² det(A) + det(Aā€²) det([ 1 2 3 4 5 6 1 2 3 ]) L, U = lu(A, NoPivot()) # elimination without row swaps U det(A), det(U) det([1 2 3 4 5 6 0 0 0]) U diag(U) prod(diag(U)) det(U), det(A) @which det(A) @which det(UpperTriangular(U)) @which det(lufact(A)) B = rand(-3:3, 5,5) det(A), det(B) det(A*B), det(A)*det(B) det(inv(A)), 1/det(A) det(A), det(A')