human
I am working on the file "Lecture-12-Fourier-Series.ipynb".
The first task is:
Using scipy we can perform this and other integrations numerically.  Two examples are given for the following functions:
Can you write Python code for it?
assistant
#Here is the Python code you requested.

from scipy import integrate
import numpy as np

def myfunc1(x):
    return np.sin(4*x)

def myfunc2(x):
    return np.sin(x)

def myfunc3(x):
    return myfunc1(x)*myfunc2(x)

def myfuncx2(x):
    return x**2

[integrate.quad(myfuncx2, 0, 4), 4.0**3/3.0]

integrate.quad(myfunc3, 0, 2*np.pi)

import sympy as sp
sp.init_printing()

n, m = sp.symbols('n m', Integer=True)
x = sp.symbols('x')

def f(x):
    return sp.sin(n*x)

def g(x):
    return sp.sin(m*x)

# scope of variables in def is local.
def func_dot(f, g, lb, ub):
    return sp.integrate(f(x)*g(x), (x, lb, ub))

func_dot(f, g, 0, 2*sp.pi)