Ok so there are two basic steps to integrating a function:
You add 1 to the power of any x term. e.g. x2 -> x3, 2x7 -> 2x8, 3 = 3x0 -> 3x
You divide the term by the new power e.g. if the new power is 3, as in the first example in the last step, you divide by 3. So x2 will integrate to x3/3. The other examples: 2x7 -> 2x8/8 which simplifies to x8/4; 3 = 3x0 -> 3x1/1 =3x
This can be generalised in the equation: Integral of axn (where a and n are constant numbers that you can sub any number in for) is ax(n+1)/(n+1). This is true for everything apart from x-1 as you cant divide by zero, which is a special case.