Evaluate $\displaystyle \int_0^{\pi}f(x)dx$

where $\displaystyle f(x) = 2sin(x), 0 \leq x< \frac{\pi}{2} $

$\displaystyle 7cos(x), \frac{\pi}{2} \leq x < \pi $

(Sorry I can't get the LaTex for piecewise to work properly, hope it's not too hard to read)

$\displaystyle \int_0^{\pi}f(x)dx = \int_0^{\frac{\pi}{2}}f(x)dx + \int_{\frac{\pi}{2}}^{\pi}f(x)dx$

= $\displaystyle \int_0^{\frac{\pi}{2}}2sin(x)dx + \int_{\frac{\pi}{2}}^{\pi}7cos(x)dx$

= $\displaystyle [-2cos(x)]_0^{\frac{\pi}{2}} + [7sin(x)]_{\frac{\pi}{2}}^{\pi}$

= $\displaystyle 2 + 7 = 9$

I believe the correct answer is -2 + 7 = 5.