3  Chapter 1

3.1 Prueba de código con python

from matplotlib import pyplot as plt
import numpy as np

def func(x,n):
    i = 0
    sum = 0
    while i <= n:
        sum = sum + np.sin((2*i+1)*x)/(2*i+1)
        i += 1
    return sum




def plotfunc(nn):
    for i in range (0,len(nn)):
         plt.plot(x, np.array([func(xp, nn[i]) for xp in x]), label=r'$\sum$ i ='+str(nn[i]),c = (np.random.random(), np.random.random(), np.random.random()))
    return

x=np.arange(0,2*np.pi,.01)

plotfunc([1,3,5,7])
plt.legend()
plt.show()