## Intro

Going on a slide is fun, and the faster the better! How do we choose the best shape of a slide between two determined start and end points to get down as fast as possible?

If we assume no friction and air resistance affects the motion, it can be proven that the optimal shape will follow the *brachistochrone curve*, which literally means *the curve of shortest time*.

The look of the curve might be surprising, since it can end up falling a bit below the end point before returning back up again.

It can, however, be proven that the curve, which is a function, is obtained through minimizing an integral depending on the time it takes for gravity to take a mass from start to finish.

The computation utilizes certain *integration techniques* that we are about to explore.

## Concept

Well, let's be honest. Finding an a primitive function is hard. Of course, if you've got something like, say, , then one primitive function is . But in the real world, these typical-textbook-example functions aren't that common.

Luckily, there are a few hacks for finding primitive functions. These hacks will allow us to deal with much messier functions.

## Math

### Variable substitution

The integral:

becomes easier if we perform the following change of variables:

Then, our integrals transforms into:

### Integration by parts

This technique is used to find the integral of products of functions. An example is:

The formula for integration by parts is:

In our example, let:

Then, according to the formula:

## Variable substitution

### Introduction

Integration is a handicraft. Some twists and turns you may need to tattoo onto the inside of you eyelids, whereas some others require that you develop some intuition. Luckily, there are guidelines even in the intuition jungle. We are here to hand you the liana as you throw yourself out into the wilderness.

This section is devoted to some very handy tricks and methods which you will need out there. The first one is a versatile beast called *variable substitution*.

Variable substitution is moving the integral into another coordinate system where it looks simpler. We want to transform it so the integral becomes as easy as possible to solve. Then, we solve it in its disguised form, and afterwards we go back to the system we started with.

Variable substitution moves the whole integral into a space where it looks simpler to solve

### How to do variable substitution

Enough talking, let's do it. Variable substitution relies on the chain rule. The theorem may look a bit intimidating at first, but as you get down to the examples, compare it with the theorem to get a feeling for it.

*Variable substitution*

Let g and g' be continuous on [a, b] and f be continuous on [g(a), g(b)]. Then, \\

The chain rule says that:

Integrating both sides gives:

Now, transforming the left hand side, we get:

Which closes the case.

Take a look at the theorem. It says: you can replace the by some function in the integrand, as long as you take care to add the and change the integration limits. I repeat, *do not forget* to modify the limits accordingly as you do the substitution.

Don't worry if you are confused at this point. We will show some examples now.

### Example 1

*Problem*:

*Solution*:

Here, we identify the integrand as something of the form which we wish to simplify.

To do this, we let introduce . This is the variable substitution. We call the new variable to not confuse ourselves with which space we are in.

With defined this way, we take the derivative with respect to :

Somewhat hand-wavy we now move the to the other side, getting:

This means we can replace in the integrand by

Thus the integrand and differential transform with :

Hey, that's really pretty! I general, we want to choose the substitution in this way, so that terms eliminate each other as we plug in the substitution into the integral.

But! Didn't we forget something?

Yep, we forgot the integration limits. Setting gives , and likewise if then .

Finally, the substitution yields:

### Example 2

*Problem*:

*Solution*:

We can use the following substitution to solve the integral:

the integral bounds are then and , the integral then becomes:

evaluating at the bounds we get:

### Example 3

*Problem*:

*Solution*:

We can use the following substitution to solve the integral:

note that there are no integral bounds, so the integral simply becomes:

substituting back we get:

## Trigonometric substitutions

Trigonometric substitutions are a subcategory of variable substitutions where we either substitute a variable by a trigonometric expression, or vice versa.

We'll go through three common cases where this type of substitutions is our saviour.

### Substituting or

Let's say we are faced with an integral like this:

If either or is an odd integer, we use trigonometric substitution. We have . Thus, if with (some integer), we can rewrite the integral as:

Then, letting will do the trick. Note that the will disappear as .

If instead, is odd, we can along the same lines use .

### Example

Lets calculate the integral:

First, rewrite:

Then, our integral can be rewritten as:

Now, perform the following change of variables:

this transform our integral to:

### A useful trigonometric identity

Say we have:

Then what? We can't use the last trick as is even. However, a neat trigonometric identity you may be familiar will do the trick.

Using that , we shuffle stuff around a bit. This gives us:

This is good, because is not hard to integrate.

Similarly, replacing by gives

It's strongly recommended to memorise either the differentiation technique or the expressions above, as they tend to appear everywhere.

### Example

Let's now evaluate the integral:

In the first step, with the help of the formula for the double angle, we can remove the power from , like this:

Now, our integral becomes:

### Inverse trigonometric substitutions

There are three cases where inverse trigonometric substitutions are great: integrals with or .

*Case 1*

If the integral contains , , then use .

Note that this only makes sense if . Making the substitution, we get:

If we need the other trigonometric functions of , we can derive them from a right-angled triangle corresponding to the substitution made.

This gives:

and

*Case 2*

If the integral contains or , with , we use .

The other trigonometric functions of are given by a similar triangle as in the first case:

So:

and:

*Case 3*

If the integral contains where , we can use .

This substitution requires some extra care. Even though:

we cannot always remove the absolute value from the tangent. The other cases above have no such warning signs blinking over them.

However, observe that is real if or .

If , then:

and .

If , then

and .

The first case gives , the second .

I know, that was a lot. But take a few breaths and give it a second think, looking back at the trigonometric functions and what substitutions we made.

### Example

In this final example, we will evaluate the integral

We can smell a trigonometric substitution with either or , because of the parenthesis in the denominator, namely:

The opportunity we see is that we can, for some constant , make a substitution so that:

The first time you see this, it probably seems far-fetched, but this is a neat trick that you'll easily learn to find after a little practice.

So, we perform the following change of variables

Then, our integral becomes

Looking back at the first triangle, our answer becomes

## Integration by parts

When learning about derivatives, we saw that products of functions complicate things a little, and we must turn to the product rule when differentiating.

The same is true for integration. To integrate a product of two functions, the method we can often use is called integration by parts. In fact, this technique can be seen as the inverse procedure of the product rule for differentiation.

Let and be two differentiable functions. Then we have:

Now if we integrate both sides with respect to , we get:

which we can rearrange as:

This formula is the base of the integration by parts method, often written like this:

or in a condensed for as:

When faced with an integral of a product of two functions, we imagine the integrand as the product of and in the left integral. We can then solve it by evaluating the expression on the right-hand side.

### Choosing and

Although the integrand still consist of a product of functions, we can often choose and in a clever way to make the integration process simple:

Given the following integral:

we choose to represent one of the functions by , and the other one together with by . For example and . Here, we want to have simple antiderivatives, since we will have to first integrate it to get , and then once more as per the formula.

There are two rules of thumb regarding the choice of and , which can be of help in order to make the integration as painless as possible:

If is a polynomial, and an exponential, sine, or cosine function, let and .

If is a logarithmic, or an inverse trigonometric function, let and .

Always remember that and are ambiguous, and you are free to algebraically rearrange the integrand, and define the two functions as they suit you.

In some cases, one application of integration by parts is not enough, and we might be forced to apply it multiple times in series before the integral gets solved.

### Example 1

To illustrate this technique, we will calculate:

Recall the integration by parts formula:

Our integral is a product of an exponential and a polynomial, so let:

Then we get:

### Example 2

In this example, we want to calculate:

This is a product of a polynomial and a trigonometric function. Lets use the formula for integration by parts:

let

Now use this to solve the integral with integration by parts:

In the last term, we have an integral of a polynomial times a trigonometric function, so we have to use integration by parts one more time:

Finally, our solution is:

## Partial fraction decomposition

In some cases, you might want to integrate a function like , where both and are polynomials.

There is a standardised procedure for tackling these kinds of problems. Truth be told, integrating these kinds of functions is quite boring.

Simplify by using polynomial division. It'd be nice to reduce the whole thing into a polynomial.

Factorise the denominator, if possible. This facilitates next step.

Partial fraction decomposition. This means writing the original fraction as a sum of a bunch of partial fractions.

Integrate each partial fraction.

As for partial fraction decomposition, here are some common guidelines:

If you've got a factor like in the denominator, you'll start out with the partial fraction .

Let's up the difficulty level. If the denominator has a factor , you'll start out with the partial fractions and .

This time, the denominator has factors like . Then you'll start out with the partial fraction .

You'll see what we mean in a moment, as we work through some examples.

### Example 1

To see how one uses integration by parts, consider the integral:

First, we want to simplify the function inside the integral:

Next, we want to find constants and such that we can write the fractions as:

Comparing both sides of the equation, we see that and must satisfy:

Solving this system of equations for and , we get:

Now, we can transform our integral as follows:

### Example 2

In the this example, we want to evaluate the integral:

using partial fractions. This fraction can be simplified as:

Comparing both sides of the equation, we see that the constants , and must satisfy:

Solving this, we get:

Now, we can transform out integral as follows: