The task is to print quotient and remainder of this polynomial fraction and then plot the original function and the quotient. I figured out how to plot the quotient, but what is the best way to plot f(x)?
import matplotlib.pyplot as plt
import numpy as np
px = np.poly1d([1, -7, 15, -21, 36])
qx = np.poly1d([1, -7, 6])
hx, rx = np.polydiv(px, qx)
print("\nh(x):")
print("\n", hx)
print("\nr(x):")
print(rx, "\n")
x = np.arange(20)
y = hx(x)
plt.grid(color='black', linestyle='dotted')
plt.plot(x, y)
plt.show()
