http://img232.imageshack.us/img232/9657/22513792.gif

Here's the solution provided:

http://img651.imageshack.us/img651/1880/68859494.gif

I don't understand how they got that answer! This is my own attempt:

Since is a piece-wise function I divided the interval to two and calculated the inner product like this:

So, why is my method and my answer wrong? And could anyone please explain the method used in the model answers?