By using integration by parts! The instructions are built in. You'll see what I mean. The identity is:
∫ uv' dx = uv - ∫u'v dx
So identify u and v', then follow the formula.
Of course, the trick is choosing which thing is u and which is v'. There's no fool proof method (trial-and-error is the core of integration). But one general rule of thumb is to choose the polynomial to be u, because that will eventually disappear from differentiation. In this case, the polynomial is just x.
u = x, and v' = sin(x/2).
u' = 1, and v = -2 cos(x/2).
Then apply the formula. Which just means copy-and-paste:
∫x sin(x/2) dx
= -2x cos(x/2) - ∫ -2 cos(x/2) dx
= -2x cos(x/2) +4 sin(x/2) +C
Edit: had some numbers wrong.