All problems
Laplacian of 2D Polynomial
Problem
Compute the Laplacian of f(x, y) = a * x^3 + b * y^3 + c * x * y^2 at (x, y):
Laplacian = f_xx + f_yy = 6 * a * x + 6 * b * y + 2 * c * x
Hint
Differentiate twice in x, twice in y, then add the two results.
Test cases
case 1
in: [1,0,1,2,3]
expected: 16
case 2
in: [0,1,0,1,-1]
expected: -6
case 3
in: [2,3,5,1,1]
expected: 40
case 4
in: [0,0,7,5,1]
expected: 70
Starter codePython
def laplacian(a, b, c, x, y):
# Your code here
pass4 test cases · run your code against them in the editor