The initial equation to integrate is is: B(n) = 0.4k * (integral(x*sin(n*pi*x),x,0,1/2) - integral(x*sin(n*pi*x),x,1/2,1) + integral(sin(n*pi*x),x,1/2,1))

I keep getting B(n) = 0.4/(n*pi)^2 * (2*sin(n*pi)/2 - cos(n*pi) + cos(n*pi)/2)

which is nowhere near the right answer. Help, please. The integration by parts is killing me. I know how to do it, but I keep messing up on it and I'm not sure where.