How do we integrate [(cosx)^2(nx)(sin(nx))]/[a-(cos(nx))] dx?

well, the first thing is to get rid of all those "nx" things. Let u = nx and we have

1/n ∫(cos^2(u)sin(u))/(a-cos(u)) du

now let
v = a-cos(u)
dv = sin(u) du
cos(u) = a-v

1/n ∫(a-v)^2/v dv

Now it's simple.

And what if the question is as follows;

Integrate [(nx)(cosx)^2(sin(nx))]/(A-(cos(nx) )?

After applying the same method as you,(I used both of the substitutions you used)I got

Integrate [(1/n)[u*(cosu)^2 dv]/v] ?
What is the cleverest method to proceed on from here?

tossing in that extra x factor makes it beyond elementary functions, as shown here:

http://www.wolframalpha.com/input/?i=%E2%88%AB(x+cos%5E2(x)sin(x))%2F(a-cos(x))+dx

To integrate the given expression, we can use the techniques of substitution and integration by parts.

Let's start with the substitution method:

1. Let u = cos(nx).
By differentiating both sides, we get du = -n sin(nx) dx.
Rearranging, we have dx = -du / (n sin(nx)).

2. Substitute u = cos(nx) and dx = -du / (n sin(nx)) in the integral.
The integral becomes:
∫ [(cos(x))^2 (nx) (sin(nx))] / [a - (cos(nx))] dx = ∫ [(u)^2 (n)] / (a - u) (-du / (n sin(nx))).
Simplifying, we get:
= -∫ [(u)^2] / (a - u) du.

Now, let's use integration by parts to further evaluate the integral:

3. Apply integration by parts, where u = (u)^2 and v' = 1 / (a - u).
Differentiating u, we get u' = 2u.
Integrating v', we get v = ln|a - u|.

4. Using the integration by parts formula, we have:
∫ [(u)^2] / (a - u) du = -u ln|a - u| - ∫ -ln|a - u| du.

5. Simplify further:
= -u ln|a - u| + ∫ ln|a - u| du.

6. To integrate ∫ ln|a - u| du, we can use another substitution.
Let w = a - u, then dw = -du.

7. Substitute w = a - u and dw = -du in ∫ ln|a - u| du.
The integral becomes:
= -∫ ln|w| dw.

8. Integrating -ln|w| with respect to w gives:
= -w ln|w| + w + C,
where C is the constant of integration.

9. Substitute back u = cos(nx) and w = a - cos(nx) in the solution.
= -[a - cos(nx)] ln|a - cos(nx)| + [a - cos(nx)].