# Piecewise functions Integration with symbol

I want to integrate one piecewise functions as following,

Assuming[ {t1 ∈ Reals && t1 > 0, t ∈ Reals && t > 0},
Integrate[
Piecewise[{{1,    x > 0    && x < t1},
{-1,    x > t1   && x < 2*t1},
{1,     x > 2*t1 && x < 3*t1},
{1 - 1, x > 3*t1 && x < 4*t1},
{0, True}}, x], {x, 0, t}]]


I have assumed t1>0 and why the output is as the picture shown?

• By the way...doesn't t1>0 imply t1 ∈ Reals? – mikuszefski Dec 9 '14 at 9:29
• You can simplify the output by feeding it to FullSimplify. – Stephen Luttrell Dec 9 '14 at 10:11
• Should the fourth piece of your piecewise function not be -1 instead of 1-1? – TransferOrbit Dec 9 '14 at 10:30
• • Are you expecting an analytical (symbolic) answer or numerical? If numerical, you'll need to specify a numerical t1. • Did you intend to have the function undefined at the boundaries of each piece (ie. x < t1 instead of x <= t1)? – TransferOrbit Dec 9 '14 at 10:39