Problem: Evaluate the integral

Solution: First we will try to determine the indefinite integral. Since there is no extra sine or cosine here to allow for an easy substitution, and we cannot simplify the denominator, we have to look deeper into the box "trigonometric integrals". Fortunately we only have even powers in our integral, so we can avoid the universal substitution and instead apply the tangent substitution:

However, at this point we have to restrict our calculations to some interval , where k is an integer. This choice will not influence the algebra in our calculations, but the answer we obtain will be only valid on the chosen interval. Now we are getting a bit ahead of ourselves, but notice that no interval as above will be enough for our given integration interval [0,2]. This will make our life harder in the end.
But right now we do not have to worry and calculate:

There is no doubt what to do next, this is a rational function. We apply partial fractions decomposition, there will be two fractions with indecomposable quadratic terms in denominators. This means that we do not get any constants for free by the cover-up trick, so we need four equations. We can try the reliable multiplying method and it turns out to be quite simple, so it may not me worth trying alternatives, but if you feel like it, yopu can obtain the necessary four equations using the limit and the plug-in methods. Details of this decomposition are here. We get

Now it is time for the back substitution. In the second term we simply substitute for y as there is nothing we can do there. In the first term it is more interesting as there tangent meets arctangent. Now it is important to recall that we integrate over some interval , so we get

This (fixed) constant k is then swallowed by the integration constant C, so we can write

This is a nice answer, but has one serious drawback. Since we are integrating a function continuous on the real line (note that the denominator is always at least one), there should be an antiderivative on the whole real line. Unfortunately we were not able to find it; this is all the more sad because now we need an antiderivative on the interval [0,2], but none of the intervals that are available covers it.

Ithappens very often that when we check on the resulting algebraic formula

we find that it works on the whole domain of the integral. Unfortunately, this is not true in this case, because the point (nor its shifts by k) cannot be substituted into the result. (However, check that at all other points, the derivative F ' is equal to the integrated function.)

This is a serious problem. Normally we would handle problems where we have antiderivatives only on subintervals by splitting the given definite integral accordingly. However, for that we need to have antiderivatives on closed intervals, whereas here we have it only on open intervals, to be precise, the problem is that the point is not covered. There are two reasonable ways to fix this. First, one can treat the given integral as an improper integral. Then the calculations go

The second alternative is to create some antiderivative on the whole given interval by connecting partial results. We start by investigating F around the critical point . One-sided limits are

So we have a jump discontinuity. Here is a picture:

Actually, this is a good news. We could try to find a suitable antiderivative by taking the function F on the interval and glue another (shifted down) copy of F to it at the point so that the two branches become continuous there. Therefore we define

Convince yourself that the function G is indeed continuous at . Since G is only a shift of F on the interval , it follows that G is an antiderivative there, it is also an antiderivative on . It remains to show that

By definition this would be quite difficult, so we prefer to use a theorem. Since G is continuous at (check, we glued it to be continuous) and because the derivative works as needed on a circular neighborhood of , the derivative must also work at . We justify this conclusion by finding one-sided limits of G ' at this point just like we did in the previous example.

So we have a function G that is the desired antiderivative on a certain interval which also contains the integrating interval [0,2]. Thus we can write

Here you can find the procedure for finding an antiderivative on the whole real line.