import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display,Math
print('f(x) is even if f(-x) = f(x)')
print('f(x) is odd if f(-x) = -f(x)')
x = np.linspace(-5,5,20)
fEven = x**2
fEvenNeg = (-x)**2
plt.plot(x,fEven)
plt.plot(x,fEvenNeg,'ro')
plt.show()
fOdd = x**3
fOddNeg=(-x)**3
fNegOdd = -fOdd
plt.plot(x,fOdd)
plt.plot(x,fOddNeg,'ro')
plt.plot(x,fNegOdd,'g')
plt.show()
theta = np.linspace(-2*np.pi,2*np.pi,39)
print(-2*np.pi)
cosfun = np.cos(theta)
cosfunN = np.cos(-theta)
plt.plot(theta,cosfun)
plt.plot(theta,cosfunN,'ro')
plt.title('$cosine(\\theta)$')
plt.show()
sinfun = np.sin(theta)
sinfunN = np.sin(-theta)
plt.plot(theta,sinfun)
plt.plot(theta,sinfunN,'ro')
plt.title('$sine(\\theta)$')
plt.show()
sinfun = np.sin(theta)
sinfunN = np.sin(-theta)
plt.plot(theta,-sinfun)
plt.plot(theta,sinfunN,'ro')
plt.title('$sine(\\theta)$')
plt.show()