I reviewed the following questions: question 1 and question 2, but I need to the following integral of a piecewise function:
A[1][t_] = Piecewise[{{1 - 2*t, 0 <= t <= 1/2}}, 0]
Integrate[A[1][x], {x, 0, t}]
I want the following output
Piecewise[{{t - t^2, 0 <= t <= 1/2}}, 0]
but I get the error
Integrate::pwrl: Unable to prove that integration limits {0,t} are real. Adding assumptions may help.
Also, for
A2[t_] = Piecewise[{{2*t, 0 <= t <= 1/2}, {2 - 2*t, 1/2 <= t <= 1}}, 0]
I need the following output:
Any suggestions?
1/2
fort=1
$\endgroup$A2
, then the needed output is wrong. $\endgroup$MapAt[Integrate[#, t] &, A2[t], {1, All, 1}]
. $\endgroup${1, All, 1}
. $\endgroup$