f[x_] := (x^2);

    Plot[f[x], {x, -2, 2}]

    a0 = (1/2) (∫_(-1)^1) f[
              x] \[DifferentialD]x

    an = (∫_(-1)^1) f[x]*
          Cos[n*π*x] \[DifferentialD]x