```
Sub NewtonRaphson()
'f_1(x1,x2) = x_1^2 + x_2^2 - 4
'f_2(x1,x2) = x_1^2 + x_2 + 1
'J_1(x1,x2) = 2*x_1 + 2*x_2
'J_2(x1,x2) = 2*x_1 - 1
'definitions
Dim x(1 To 2, 1 To 1) As Double
Dim J(1 To 2, 1 To 2) As Double
Dim R(1 To 2, 1) As Double
Dim dx As Variant
'Initial Guess
x(1, 1) = 1
x(2, 1) = 2
R(1, 1) = 1
R(2, 1) = 1
Do Until Abs(R(1, 1)) < 0.0000000001 And Abs(R(2, 1)) < 0.0000000001
J(1, 1) = 2 * x(1, 1)
J(1, 2) = 2 * x(2, 1)
J(2, 1) = 2 * x(1, 1)
J(2, 2) = -1
R(1, 1) = -(x(1, 1) ^ 2 + x(2, 1) ^ 2 - 4)
R(2, 1) = -(x(1, 1) ^ 2 - x(2, 1) + 1)
Jinv = Application.MInverse(J)
strng = ""
For a = 1 To 2
strng = strng & Jinv(a, 1) & " " & Jinv(a, 2) & " " & R(a, 1) & vbNewLine
Next a
MsgBox (strng)
[COLOR=#ff0000]dx = Application.MMult(Jinv, R)[/COLOR]
strng = dx(1, 1) & vbNewLine & dx(2, 1)
MsgBox (strng)
For a = 1 To 2
x(a, 1) = x(a, 1) + dx(a, 1)
Next a
Loop
MsgBox (x(1, 1) & vbNewLine & x(2, 1))
End Sub
```