using LinearAlgebra
A = rand(3,3)
3×3 Array{Float64,2}: 0.262707 0.722601 0.227894 0.194994 0.545517 0.595722 0.465314 0.686887 0.644692
A2 = A^2
3×3 Array{Float64,2}: 0.31596 0.740561 0.63726 0.434797 0.847685 0.753471 0.556164 1.15377 0.930863
dA = [0.001 0.002 0.003 ; 0.004 0.005 0.006 ; 0.007 0.008 0.009]
3×3 Array{Float64,2}: 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009
(A + dA)^2 - A2
3×3 Array{Float64,2}: 0.00682701 0.00987187 0.0105702 0.0114308 0.0177037 0.0170739 0.0154144 0.0252529 0.0236327
A*dA + dA*A
3×3 Array{Float64,2}: 0.00679701 0.00983587 0.0105282 0.0113648 0.0176227 0.0169779 0.0153124 0.0251269 0.0234827
2*A*dA
3×3 Array{Float64,2}: 0.00949674 0.0119231 0.0143495 0.0130942 0.0157667 0.0184392 0.0154514 0.0190452 0.022639
2*dA*A
3×3 Array{Float64,2}: 0.00409727 0.00774859 0.00670683 0.00963536 0.0194786 0.0155167 0.0151735 0.0312086 0.0243265
AI = inv(A)
3×3 Array{Float64,2}: -0.85783 -4.61434 4.56708 2.25985 0.944638 -1.67173 -1.78861 2.32399 0.0359288
inv(A+dA)-inv(A)
3×3 Array{Float64,2}: 0.00361557 0.0219253 -0.0380485 -0.000140811 -0.0161177 0.0188606 0.00369236 0.0071466 -0.0214998
-AI*dA*AI
3×3 Array{Float64,2}: 0.0036997 0.0220909 -0.0385415 -0.0001703 -0.0161938 0.0190541 0.0037521 0.00724607 -0.0218293