Skip to content
DeepForgeby svx
All problems
EasyCalculusca-145

Inverse Function Theorem Jacobian

Problem

The inverse function theorem states that the Jacobian of the inverse map at a point is the inverse of the Jacobian at the corresponding point.

For J = [[a, b], [c, d]], return (1 / det) * [[d, -b], [-c, a]], or None when det = a*d - b*c == 0.

Hint

The inverse is the adjugate divided by the determinant; a zero determinant means no local inverse.

Test cases

case 1
in: [1,0,0,1]
expected: [[1,0],[0,1]]
case 2
in: [2,1,1,1]
expected: [[1,-1],[-1,2]]
case 3
in: [1,2,3,4]
expected: [[-2,1],[1.5,-0.5]]
case 4
in: [2,4,1,2]
expected: null
Starter codePython
def inverse_jacobian(a, b, c, d):
    # Return the inverse 2x2 matrix, or None
    # Your code here
    pass

4 test cases · run your code against them in the editor