I work with symbolic toolbox, and here is my code:
syms x h
g=(1-x).*(1-x+h);
int(g,-inf,inf)
and the result is :
ans = piecewise([h in R_, Inf], [0 < sign(Im(h)) and h in R_, Inf + i*Inf], [sign(Im(h)) < 0 and h in R_, Inf - i*Inf])
the answer I calculated was:1/3-0.5*h+1/6*h^3
and I want to get this answer using MATLAB
Are there some way to get it?