Well, so far you have done just about everything wrong! First, you posted this in "Learning Materials" rather than in the homework section. Second, although you say you have "tried so many different ways", you have shown none of them so we can't say what you might have done wrong.
Are you having difficulty integrating -3 cos(pi x)? Or is it -x sin(pi x)?
The first should be easy and the second not to difficult to do using integration by parts.