Integration

Ok, there’s a little rule that I’ve forgotten, so if somebody could help me out I’d appreciate it very much. I’ve written a simple sample of what I’m looking for, if you could tell me which is the correct of the 2 answers, I would much appreciate it. Thanks!

image updated