You probably want
f1(x) = piecewise(x < -sym(pi), 0,x < 0,-x-sym(pi), x<=sym(pi), x+sym(pi), x>sym(pi), 0);
You'll find some other typos in your code, like using "it" instead of "int" in the equation for ak and pix instead of pi*x in the equation for F1.
Recommend defining
syms L
L = sym(pi)
and then use L everywhere instead of pi.