Hi PG,
well if you did the same thing and didnt get the right answer then you probably just made a simple mistake which once corrected solves the problem.
I just took another look (the writing was a little hard to read) and i see that you did not do the same thing, that's the problem. When we use the logical relations:
c=(t>a)*(t<b)
when t is greater than a but less than b we get c=1, but for t outside this range we get 0. So this little time function acts as a numerical selector, that selects the function that it is multiplied by. For example, the first function is:
f1=-2-6*t
but we multiply it by the time selector for that period, which is:
c=(t>-2)*(t<-3)
and so we get:
f1=(t>-2)*(t<-3)*(-2*-6*t)
The next function is f2 which goes from -2 to -1 so we get:
f2=(t>-1)*(t<-2)*(3*t+4)
So now when t is between -1 and -2 only function f2 contributes to the integration. however, keep in mind that these are still just part of the g1 function, and so far has nothing to do with g4. We cant integrate these directly, we have to do that via function g4 which is:
g4(t)=g1((t-3)/2)
And now we can integrate numerically (assuming we add the other functions):
Result=Integral[-3 to 1](g4(t)) dt
To do this numerically, you could just use the time selector functions shown above and integrate the whole thing numerically. The time selector functions will switch the proper functions in when the time is between the lower and upper limits. Note however that the time values are the transformed time values not the time values of the original limits.
I thought i had made this a little clearer with the red function i drew on your diagram. That shows the actual function you are integrating.
To help make this a little more clear, we can just do the mapping from g1a to h1a for example, which gives us:
h1a(t)=g1a((t-3)/2)
h1b(t)=g1b((t-3)/2)
h1c(t)=g1c((t-3)/2)
h1d(t)=g1d((t-3)/2)
so then h1 is:
h1(t)=h1a(t)+h1b(t)+h1c(t)+h1d(t)
and now we integrate h1(t) from -3 to 1.
Note g1a through g1d are the functions you already found multiplied by it's time selector such as:
g1a=(-2*t-6)*(t>-3)*(t<-2)
etc. for g1b through g1d.
But since we can graph this new function h1(t) we see we can redefine it as:
H1a(t)=-t-3 {from t=-3 to t=-1}
H1b(t)=(3*t-1)/2 {from t=-1 to +1}
So we could integrate those two functions with those two sets of limits instead and sum the results. The result is -3. H1(t) is the plot shown in red in your diagram which i drew on with the two sets of limits imposed.
So that's two ways to do it, but notice that we could not integrate the original function piece by piece unless we do it numerically over the whole range and where we make a new function with the time selectors (it is then all one function, g4(t)).