In this example we should use the beta function. But I'm a bit lost, because I don't know how to change the limits of the integral to fit the one that is needed when using B-function.

The problem goes like this:
integrate cos^7(x) dx, limits of the integral are from 0 to pi.

To evaluate the integral ∫cos^7(x) dx with limits from 0 to π, we can use the beta function.

The beta function is defined as B(a, b) = ∫[0,1] t^(a-1) (1-t)^(b-1) dt, where a and b are positive real numbers.

In this case, we want to express the integral of cos^7(x) dx in terms of the beta function. Here's the step-by-step procedure:

Step 1: Rewrite cos^7(x) using the identity cos^2(x) = (1 + cos(2x)) / 2.
cos^7(x) = cos^2(x) * cos^2(x) * cos^2(x) * cos(x)
= (1 + cos(2x)) / 2 * (1 + cos(2x)) / 2 * (1 + cos(2x)) / 2 * cos(x)

Step 2: Expand the expression using the binomial theorem.
(1 + cos(2x))^3 = 1 + 3cos(2x) + 3cos^2(2x) + cos^3(2x)

Therefore, cos^7(x) can be rewritten as:
cos^7(x) = [(1 + cos(2x))^3 / 8] * cos(x)

Step 3: Now we can express the integral of cos^7(x) dx in terms of the beta function.
∫[0,π] cos^7(x) dx = ∫[0,π] [(1 + cos(2x))^3 / 8] * cos(x) dx
= [1 / 8] ∫[0,π] [(1 + cos(2x))^3 * cos(x)] dx

Step 4: Apply the substitution t = (1 + cos(2x)) / 2, which leads to dt = -sin(2x) dx.
The new limits of integration will be t(0) = (1 + cos(0)) / 2 = 1 and t(π) = (1 + cos(2π)) / 2 = 1.
Therefore, the integral becomes:
[1 / 8] ∫[1, 1] [t^3 * (-2 sin(2x))] dt
= -[1 / 4] ∫[1, 1] [t^3 sin(2x)] dt

Step 5: Now we can use the beta function to evaluate the integral.
Recall that B(a, b) = ∫[0,1] t^(a-1) (1-t)^(b-1) dt.

Comparing with the form of our integral, we see that:
a = 4 and b = 1

Using the definition of the beta function, we can rewrite our integral as:
-[1 / 4] ∫ [1, 1] [t^3 sin(2x)] dt = -[1 / 4] B(4, 1)

Finally, we have expressed the given integral in terms of the beta function. The integral ∫[0,π] cos^7(x) dx can be evaluated as -[1 / 4] B(4, 1).