This is the code
from sympy import *
from sympy.abc import x,n
fx=input("Function ")
ao = (1/pi)*(integrate(fx,(x,-pi, pi)))
print("ao= ",ao)
an = (1/pi)*integrate(fx*(cos(2*n*x)),(x,-pi,pi))
print("an= ",an)
bn = (1/pi)*integrate(fx*sin(2*n*x),(x,-pi,pi))
print("bn= ",bn)
When I try with the function x or some other it doesnt work. The error is TypeError: can't multiply sequence by non-int of type 'cos' I dont fully understand why that error occurs, please tell me what is my mistake