The original problem is: f(x) = x if -pi<x<0, and f(x) = pi - x if 0<x<pi. I'm supposed to model this as a Fourier series. I got the sine series correct, but for some reason, when I try to calculate the cosine series as 1/pi * integral[f(x)*cos(nx) dx, -pi, pi], I keep coming up with zero. I cannot spot my error. I don't know if the issue is setting it up, the integration by parts, or what.