All problems
Exact Differential Form Check
Problem
Write M(x, y) = m0 + m1 x + m2 y + m3 x^2 + m4 x y + m5 y^2 and N similarly with coefficients n0..n5. The form M dx + N dy is exact when dM/dy = dN/dx, that is when m2 = n1, m4 = 2 n3, and 2 m5 = n4.
Given the six coefficients of M and of N, return True when the form is exact.
Hint
Differentiate M by y and N by x on the common monomial basis.
Test cases
case 1
in: [[0,0,2,0,0,0],[0,2,0,0,0,0]]
expected: true
case 2
in: [[0,0,1,1,0,0],[0,0,0,0,2,0]]
expected: false
case 3
in: [[0,0,0,0,0,1],[0,0,0,0,2,0]]
expected: true
Starter codePython
def exact_differential_form_check(m, n):
# Your code here
pass3 test cases · run your code against them in the editor