
How to get to the part circled with red? I tried to compute it on Wolfram alpha.. (http://www.wolframalpha.com/input/?i=2%2FL+*Integrate+x+sin%28%28n+pi+x%29%2FL%29+dx+from+0+to+L) Still confused. Need help.

How to get to the part circled with red? I tried to compute it on Wolfram alpha.. (http://www.wolframalpha.com/input/?i=2%2FL+*Integrate+x+sin%28%28n+pi+x%29%2FL%29+dx+from+0+to+L) Still confused. Need help.
It's all right, the only problem is that Wolfram Alpha didn't know that $n$ is an integer. For a non-integral $n$, you can't in general simplify Wolfram Alpha's result. For $n$ an integer, you can simplify
$$\sin (n\pi) = 0$$
and
$$\cos (n\pi) = (-1)^n$$
to get the simpler result.