No need to say that integration is a difficult task. Following tips will help you in integrating.
You should have good knowledge of Calculus I. Without this, studying Calculus II is very difficult.
You should memorize integrals of basic functions. Integral ∫sec(x)tan(x)dx looks difficult unless you know that ∫sec(x)tan(x)dx=sec(x)+C.
You should master all integration techniques. You can't just memorize formulas, you need to understand them and know how they work. For example, you can memorize formula for integration by parts, but it doesn't mean that you can successfully use it. You need to look at integral and realize whether you can use integration by parts and if yes then how to use it. For example, it is note very clear whether we can use integration by parts for ∫sec(x)tan2(x)dx. In fact we can if we set u=tan(x) and dv=sec(x)tan(x)dx then du=sec2(x)dx and v=sec(x).
Simplify integrand as much as possible to integrate it. For example, ∫sin2(x)dx can't be integrated directly, however we can simplify it by using double angle formula: ∫sin2(x)dx=21∫(1−cos(2x))dx=21(x−21sin(2x))+C. Sometimes just rewriting tricks needed. For example, multiplying numerator and denominator by same value: ∫sec(x)dx=∫sec(x)+tan(x)sec(x)(sec(x))+tan(x)dx=∫tan(x)+sec(x)sec2(x)+sec(x)tan(x)dx==ln∣tan(x)+sec(x)∣+C
Identify the type of integral. If integrand is rational expression, then maybe it is possbile to use partial fraction decomposition. If integrand is product of polynomial, exponential, trigonometric or logartihmic functions then integration by parts may work. If integrand involves roots then trigonometric substitution may work.
Check whether "simple" substitution will work. Integral ∫xx2+1dx can be solved using trigonometric substitution, but there is simpler substitution that will also work, namely, u=x2+1.
Prepare to use multiple technniques. Many of integrals require use of more than one technique. For example you use substitution rule, then integration by parts and then again substitution rule.
Try to relate integral we already know how to do or to integrals listed in Table of Integrals. Typical example is ∫cos(x)sin2(x)+1dx. Using substitution u=sin(x) this integral is converted to ∫u2+1du which we already know how to do from Trigonometric Substitutions Note (Substitution t=tan(u) ). Note that we use substitution rule twice.
Try everyhing you can. If all techniques that you've tried failed, look at integral from another side and try technique that you didn't use.
Practice, practice and once more practice. You will master integration only after you will solve a whole bunch of integrals. In this case you will be able to "see" correct substitutions and identify integral.
Not all integrals can be expressed in terms of elementary fuctions. For, example we can't find ∫e−x2dx, ∫xsin(x)dx etc. Just remember about it.
Now, we can use trigonometric identity 1−cos2(x)=sin2(x).
Integral now becomes ∫sin2(x)1−cos(x)dx=∫sin2(x)1dx−∫sin2(x)cos(x)dx.
Now, where tip 2 is used. We should know integrals of basic functions: ∫sin2(x)1dx=∫csc2(x)dx=−cot(x)+C1.
In the second integral we see that cos(x) is in numerator, so substitution u=sin(x) will work. In this case du=cos(x)dx and ∫sin2(x)cos(x)dx=∫u21du=−u1+C2=−sin(x)1+C2.
Finally, ∫1+cos(x)1dx=−cot(x)+C1−(−sin(x)1+C2)=sin(x)1−cot(x)+C where C=C1−C2.
Note, that answer can be given differently if we rewrite answer using trigonometric identities: sin(x)1−cot(x)=sin(x)1−cos(x)=1+cos(x)sin(x)=tan(2x).
Example 2. Integrate ∫sin(x)dx.
It seems non standard integral, but substitution u=x will convert it to standard. In this case du=2x1dx or dx=2xdu=2udu.
Integral becomes ∫2usin(u)du. This is classic example of integration by parts.
So, 2∫usin(u)du=−2ucos(u)+2sin(u)+C=−2xcos(x)+2sin(x)+C.
Example 3. Evaluate ∫sec4(x)dx.
We will use reduction formula from table of integrals: