So I have to integrate this function... looked simple enough at first but soon I found it was not so. I've found the answer using wolframalpha and solutions etc. but don't understand completely how to get there

I first tried integrating sin(abs(x)) just to -cos(abs(x)) and got 0+1/sqrt(2), obviously wrong. Then I tried to break it up - integral of sinx=-cosx for the positive value and integral of sin(-x)=cosx for the negative value, but this just gave me -1/sqrt(2)...

How exactly do I have to break this up to get it to work?

Thank you for any advice!