To solve the problem, we need to evaluate the integral
\[
\int \left[(3x-1) \cos x + (1-2x) \sin x\right] dx
\]
and express it in the form \( P \cos x + Q \sin x \), where \( P \) and \( Q \) are polynomials in \( x \).
### Step 1: Split the Integral
We can split the integral into two parts:
\[
I = \int (3x - 1) \cos x \, dx + \int (1 - 2x) \sin x \, dx
\]
### Step 2: Evaluate the First Integral
Let’s denote the first integral as \( I_1 = \int (3x - 1) \cos x \, dx \). We will use integration by parts, where we let:
- \( u = 3x - 1 \) (which gives \( du = 3 \, dx \))
- \( dv = \cos x \, dx \) (which gives \( v = \sin x \))
Using the integration by parts formula \( \int u \, dv = uv - \int v \, du \):
\[
I_1 = (3x - 1) \sin x - \int \sin x \cdot 3 \, dx
\]
Calculating the remaining integral:
\[
\int \sin x \, dx = -\cos x
\]
Thus,
\[
I_1 = (3x - 1) \sin x + 3 \cos x
\]
### Step 3: Evaluate the Second Integral
Now, we evaluate the second integral \( I_2 = \int (1 - 2x) \sin x \, dx \). Again, we will use integration by parts:
Let:
- \( u = 1 - 2x \) (which gives \( du = -2 \, dx \))
- \( dv = \sin x \, dx \) (which gives \( v = -\cos x \))
Using the integration by parts formula:
\[
I_2 = (1 - 2x)(-\cos x) - \int -\cos x \cdot (-2) \, dx
\]
Calculating the remaining integral:
\[
\int \cos x \, dx = \sin x
\]
Thus,
\[
I_2 = -(1 - 2x) \cos x + 2 \sin x
\]
### Step 4: Combine the Results
Now we combine \( I_1 \) and \( I_2 \):
\[
I = I_1 + I_2
\]
Substituting the results we found:
\[
I = \left[(3x - 1) \sin x + 3 \cos x\right] + \left[-(1 - 2x) \cos x + 2 \sin x\right]
\]
Simplifying this gives:
\[
I = (3x - 1 + 2) \sin x + (3 - (1 - 2x)) \cos x
\]
This simplifies to:
\[
I = (3x + 1) \sin x + (2x + 2) \cos x
\]
### Step 5: Identify P and Q
From the expression \( I = P \cos x + Q \sin x \), we can identify:
- \( P = 2x + 2 \)
- \( Q = 3x + 1 \)
### Final Result
Thus, the polynomials \( P \) and \( Q \) are:
- \( P = 2x + 2 \)
- \( Q = 3x + 1 \)