You can define $f$ in terms of the Heaviside function and then integrate directly without any imports. Try this code:
f(x) = heaviside(x-pi/2)
show(html(f"$c_{{{n}}}={latex(c(n))}$"))