Finding the average and RMS value of this signal
You are making this way too complicated.  Maybe those equations are right, but I didn't bother looking at them.

Stop and actually think about the situation you have.

Start with the average.  That's easy to do from inspection.  You can immediately see that from t = 0 to 3 is a ramp, so the average is the average of its ends.  The average of the first 3 ms is therefore 2.5.  The next two ms cancel to average to 0.  The next two is one full sine cycle, so the average is again 0.  The remainder of this signal to 10 ms has two parts at 5 and 1 part at 10.  So to recap, you have 3/10 of 2.5, 4/10 of 0, 2/10 of 5, and 1/10 of 10.  You don't even need a calculator to average that.

Attack the RMS similarly.  You can average the RMS of each 1 ms time segment.  The only moderately tricky part is finding the RMS of the first 3 ms.  After that, it's either provided outright, or comes from something you should already know without having to look it up.

Just do it.