Answer :

Let's solve the integral [tex]\(\int \frac{\sin x}{\cos^2 x - 5 \cos x + 4} \, dx\)[/tex] by resolving it into partial fractions and then integrating.

### Step 1: Simplify the Denominator
First, we simplify the denominator [tex]\(\cos^2 x - 5 \cos x + 4\)[/tex]. We can rewrite it in terms of a single variable by letting [tex]\(u = \cos x\)[/tex]. This gives us:
[tex]\[ u^2 - 5u + 4 \][/tex]

### Step 2: Factor the Denominator
Next, we factor the quadratic expression:
[tex]\[ u^2 - 5u + 4 = (u - 1)(u - 4) \][/tex]
So, the original integrand becomes:
[tex]\[ \int \frac{\sin x}{(\cos x - 1)(\cos x - 4)} \, dx \][/tex]

### Step 3: Resolve into Partial Fractions
To resolve the integrand into partial fractions, we can write:
[tex]\[ \frac{\sin x}{(\cos x - 1)(\cos x - 4)} = \frac{A}{\cos x - 1} + \frac{B}{\cos x - 4} \][/tex]
where [tex]\(A\)[/tex] and [tex]\(B\)[/tex] are constants to be determined.

### Step 4: Determine Constants [tex]\(A\)[/tex] and [tex]\(B\)[/tex]
We combine the fractions on the right-hand side to find [tex]\(A\)[/tex] and [tex]\(B\)[/tex]:
[tex]\[ \frac{A}{\cos x - 1} + \frac{B}{\cos x - 4} = \frac{A(\cos x - 4) + B(\cos x - 1)}{(\cos x - 1)(\cos x - 4)} \][/tex]
[tex]\[ \sin x = A(\cos x - 4) + B(\cos x - 1) \][/tex]
We now equate the numerators:
[tex]\[ \sin x = A\cos x - 4A + B\cos x - B \][/tex]
[tex]\[ \sin x = (A + B)\cos x - 4A - B \][/tex]

Since there is no [tex]\(\cos x\)[/tex] term on the left side, we have:
[tex]\[ A + B = 0 \][/tex]
and since [tex]\(\sin x\)[/tex] is the only term with [tex]\(x\)[/tex]:
[tex]\[ -4A - B = 0 \][/tex]

From [tex]\(A + B = 0\)[/tex], we get [tex]\(B = -A\)[/tex]. Substitute [tex]\(B = -A\)[/tex] into the second equation:
[tex]\[ -4A - (-A) = 0 \][/tex]
[tex]\[ -4A + A = 0 \][/tex]
[tex]\[ -3A = 0 \][/tex]
Since this implies [tex]\(A = 0\)[/tex], but actually, we should have [tex]\(4A + A = 0\)[/tex], thus solving:
[tex]\[ -4A - A = 0 \][/tex]
[tex]\( -5A = -1\)[/tex]
We find [tex]\(A = 1, B=-1.\)[/tex]

### Step 5: Integrate Each Component
Now that we have the partial fractions, we return to the original integral:

[tex]\[ \int \frac{\sin x}{(\cos x - 1)(\cos x - 4)} \, dx = \int \frac{1}{\cos x - 1} - \frac{1}{\cos x - 4} \sin x \, dx \][/tex]

We change of variables. Let [tex]\(u = \cos x\)[/tex], then [tex]\(du = -\sin x \, dx\)[/tex] or [tex]\(dx = -\frac{du}{\sin x}\)[/tex]

So each part integrates:

[tex]\[\int \frac{-du}{u-1} -\int \frac{-du}{u-4} = -\int \frac{1}{u-1} - \frac{1}{u-4}\, du \][/tex]

The antiderivatives simplify to:

[tex]\[ = \left[-\ln|u-1| \right] -\left[\ln| u-4|\right) \][/tex]

Converting back to [tex]\(x\)[/tex]:

[tex]\[\left[ -\cos x |^3/3] + 5cos(x)^2/2 - 4 cos\][/tex]