Skip to content
DeepForgeby svx
All problems
HardCalculusca-166

Saddle Classification 2D

Problem

Find and classify the critical points of f(x, y) = x^3 - 3x + y^2 on the line y = 0.

The critical x values satisfy 3x^2 - 3 = 0 and the Hessian is [[6x, 0], [0, 2]]. Classify the point (x, y): return "saddle" when the determinant is negative, "minimum" or "maximum" when it is positive according to the sign of H_xx, and "degenerate" when it is zero.

Hint

At x = 0 the Hessian is only positive semidefinite, so the second derivative test is inconclusive.

Test cases

case 1
in: [1,0]
expected: "minimum"
case 2
in: [-1,0]
expected: "saddle"
case 3
in: [0,0]
expected: "degenerate"
case 4
in: [0.5,0]
expected: "minimum"
Starter codePython
def saddle_classify_2d(x, y):
    # Your code here
    pass

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