Concept:
The given differential equation is a first-order linear differential equation of the form:
\[
\frac{dy}{dx} + P(x)y = Q(x)
\]
where $P(x) = (x^2 - 2x)\cos x + 2(x - 1)\sin x$.
The integrating factor ($I.F.$) of such an equation is given by:
\[
I.F. = e^{\int P(x) \, dx}
\]
We are given that $I.F. = e^{f(x)}$, which implies:
\[
f(x) = \int P(x) \, dx = \int \left[ (x^2 - 2x)\cos x + 2(x - 1)\sin x \right] dx
\]
Step 1: Evaluate the integral using integration by parts or recognizing an exact derivative structure.
Let us look closely at the terms inside the integrand:
Notice that the derivative of $(x^2 - 2x)$ is $2(x - 1)$, and the integral of $\cos x$ is $\sin x$. This strongly suggests the application of the product rule for differentiation, namely $\frac{d}{dx}[u(x)v(x)] = u'(x)v(x) + u(x)v'(x)$.
Let us test the derivative of the function $g(x) = (x^2 - 2x)\sin x$:
\[
\frac{d}{dx}\left[ (x^2 - 2x)\sin x \right] = \frac{d}{dx}(x^2 - 2x) \cdot \sin x + (x^2 - 2x) \cdot \frac{d}{dx}(\sin x)
\]
\[
= 2(x - 1)\sin x + (x^2 - 2x)\cos x
\]
This expression matches the integrand perfectly!
Step 2: Write down the expression for $f(x)$.
Since the integrand is the exact derivative of $(x^2 - 2x)\sin x$, the integral simplifies to:
\[
f(x) = (x^2 - 2x)\sin x
\]
(We omit the constant of integration as it is conventional when determining specific standard forms of functions for evaluating values).
Step 3: Calculate $f(3)$.
Substitute $x = 3$ into the function $f(x)$:
\[
f(3) = (3^2 - 2(3))\sin 3
\]
\[
f(3) = (9 - 6)\sin 3 = 3\sin 3
\]