Example 1: \( \int x e^x\,dx \)
Let \(u = x\), \(dv = e^x dx\).
Then \(du = 1dx\), \(v = e^x\).
\[
\int x e^x dx = x e^x - \int e^x dx = x e^x - e^x + C = e^x(x - 1) + C
\]
Example 2: \( \int x\sin x\,dx \)
Let \(u = x\), \(dv = \sin x dx\).
Then \(du = dx\), \(v = -\cos x\).
\[
\int x\sin x dx = -x\cos x + \int \cos x\,dx
= -x\cos x + \sin x + C
\]
Example 3: \( \int x\ln x\,dx \)
Important: \(\ln x\) must be chosen as \(u\).
Let \(u = \ln x\), \(dv = x\,dx\).
Then \(du = \frac{1}{x}dx\), \(v = \frac{x^2}{2}\).
\[
\int x\ln x\,dx = \frac{x^2}{2}\ln x - \frac{x^2}{4} + C
\]
Example 4 (Repeated): \( \int x^2 e^x\,dx \)
First apply parts with \(u = x^2\).
You must apply it twice:
\[
\int x^2 e^x dx = x^2 e^x - 2 \int x e^x dx
\]
Then use the result from Example 1.
Final answer:
\[
\int x^2 e^x dx = e^x(x^2 - 2x + 2) + C
\]
Example 5 (Exam Style): \( \int x e^{-x}\,dx \)
Let \(u = x\), \(dv = e^{-x} dx\).
Then \(du = dx\), \(v = -e^{-x}\).
\[
\int x e^{-x} dx = -x e^{-x} - \int (-e^{-x})dx
= -x e^{-x} - e^{-x} + C = -(x + 1)e^{-x} + C
\]