from sympy import symbolsimport numpy as npimport matplotlib.pyplot as plt
x, y = symbols('x y')
eq = x*2 + xy
x_vals = np.linspace(-10, 10, 400)y_vals = eq.subs(x, x_vals)
plt.figure(figsize=(8, 6))plt.plot(x_vals, y_vals, label='$x^2 + xy = 0$')plt.xlabel('x')plt.ylabel('y')plt.title('Graph of $x^2 + xy = 0$')plt.grid(True)plt.axhline(0, color='black',linewidth=0.5)plt.axvline(0, color='black',linewidth=0.5)plt.legend()plt.show()
from sympy import symbols
Define the variablesimport numpy as np
import matplotlib.pyplot as plt
x, y = symbols('x y')
Define the equationeq = x*2 + xy
Plot the curvex_vals = np.linspace(-10, 10, 400)
y_vals = eq.subs(x, x_vals)
plt.figure(figsize=(8, 6))
plt.plot(x_vals, y_vals, label='$x^2 + xy = 0$')
plt.xlabel('x')
plt.ylabel('y')
plt.title('Graph of $x^2 + xy = 0$')
plt.grid(True)
plt.axhline(0, color='black',linewidth=0.5)
plt.axvline(0, color='black',linewidth=0.5)
plt.legend()
plt.show()