import matplotlib.pyplot as plt
import numpy as np


def P(x) :
    return x**4+x**3-6*x**2
    
def Q(x) :
    return -x**4+x**3+5*x**2-3*x+6
    
# X = np.linspace(-3,2,100)
# Y,Z = [],[]
# for x in X :
#     Y.append(P(x))
#     Z.append(Q(x))
# plt.plot(X,Y)
# plt.plot(X,Z)
# plt.show()

def f(x,y) :
    return P(x)-Q(y)
    
f = np.vectorize(f)

X = np.arange(-4,4,0.01)
Y = np.arange(-4,4,0.01)
X,Y = np.meshgrid(X,Y)
Z = f(X,Y)
plt.axis('equal')
plt.contour(X,Y,Z,[0])
plt.show()