fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
# Circle x^2 + y^2 = 4
theta = np.linspace(0, 2*np.pi, 300)
ax1.plot(2 * np.cos(theta), 2 * np.sin(theta), color='purple', label='$x^2 + y^2 = 4$')
ax1.scatter([0, 0, 2, -2], [2, -2, 0, 0], color='red', zorder=5)
ax1.annotate('$(0, 2)$', (0.1, 2.1))
ax1.annotate('$(0, -2)$', (0.1, -2.3))
ax1.annotate('$(2, 0)$', (2.1, 0.1))
ax1.annotate('$(-2, 0)$', (-2.8, 0.1))
ax1.axhline(0, color='black', linewidth=0.8, linestyle='--')
ax1.axvline(0, color='black', linewidth=0.8, linestyle='--')
ax1.set_aspect('equal')
ax1.set_xlim(-3, 3)
ax1.set_ylim(-3, 3)
ax1.set_title('Circle: $x^2 + y^2 = 4$')
ax1.grid(True, linestyle=':', alpha=0.6)
# Cubic Polynomial y = (x - 2)(2x^2 + 7x + 3)
x_cubic = np.linspace(-3.5, 2.5, 200)
y_cubic = (x_cubic - 2) * (2 * x_cubic**2 + 7 * x_cubic + 3)
ax2.plot(x_cubic, y_cubic, color='teal', label='$y = (x-2)(2x^2+7x+3)$')
ax2.scatter([-3, -0.5, 2, 0], [0, 0, 0, -6], color='red', zorder=5)
ax2.annotate('$(-3, 0)$', (-3.4, 1.5))
ax2.annotate('$(-0.5, 0)$', (-1.1, -3))
ax2.annotate('$(2, 0)$', (1.8, 2))
ax2.annotate('$(0, -6)$', (0.1, -6))
ax2.axhline(0, color='black', linewidth=0.8, linestyle='--')
ax2.axvline(0, color='black', linewidth=0.8, linestyle='--')
ax2.set_xlim(-4, 3)
ax2.set_ylim(-15, 10)
ax2.set_title('Cubic Intercepts: 3 Real Roots')
ax2.grid(True, linestyle=':', alpha=0.6)
plt.tight_layout()
plt.show()