Question: Piecwise function integral

when I define piecwise function as

f := x -> piecewise(0 <= t, 1, t < 0, t - 1)

and I define his antiderivative

F := x -> int(f(t), t = 1 .. x)

F(x)

Maple gives

x - 1

which is obviously wrong (but I guess it's ok only for x=>0)

what to do to be correct?

Please Wait...