Example. Calculate the definite integral

$$
\int_{1}^{2} x \ln ^{2} x d x
$$
## Solution.

1. Let's represent the integrand as a product of two functions $F(x) g(x)$, where $g(x)$ has an obvious antiderivative $G(x)$, and $F(x)$ is a differentiable function, with its derivative $f(x)=F'(x)$ being a simpler function than $F(x)$.

In this case,

$$
F(x)=\ln^2 x, \quad g(x)=x, \quad G(x)=\frac{x^2}{2}, \quad f(x)=F'(x)=2 \ln x \cdot \frac{1}{x}
$$

2. Apply the integration by parts formula

$$
\int_{1}^{2} x \ln^2 x \, dx = \left. \frac{x^2}{2} \ln^2 x \right|_{1}^{2} - \int_{1}^{2} \frac{x^2}{2} \cdot 2 \ln x \cdot \frac{1}{x} \, dx = 2 \ln^2 2 - \int_{1}^{2} x \ln x \, dx
$$

3. The last integral is not a standard integral, but we can apply the integration by parts formula again:

$$
\int_{1}^{2} x \ln x \, dx = \left. \frac{x^2}{2} \ln x \right|_{1}^{2} - \int_{1}^{2} \frac{x^2}{2} \cdot \frac{1}{x} \, dx = 2 \ln 2 - \left. \frac{x^2}{4} \right|_{1}^{2} = 2 \ln 2 - \frac{3}{4}
$$

Answer. $\int_{1}^{2} x \ln^2 x \, dx = 2 \ln^2 2 - 2 \ln 2 + \frac{3}{4}$.

Conditions of the Problems. Compute the definite integrals.

1. $\int_{0}^{1} x e^{-x} \, dx . \quad 2. \int_{0}^{1} x \operatorname{arctg} x \, dx$.
2. $\int_{1}^{2} \ln x \, dx$.
3. $\int_{0}^{2 \pi} x^2 \cos x \, dx$.
4. $\int_{1}^{3} \operatorname{arctg} \sqrt{x} \, dx$.
5. $\int_{0}^{1} \arcsin^2 x \, dx$.
6. $\int_{1}^{e} \ln^2 x \, dx$.
7. $\int_{0}^{\pi / 3} \frac{x \sin x}{\cos^2 x} \, dx$.
8. $\int_{0}^{\pi} e^x \cos^2 x \, dx$.
9. $\int_{1}^{e^{\pi / 2}} \cos \ln x \, dx$.

Answers. 1. $(e-2) / e .2 .(\pi-2) / 4.3 .2 \ln 2-1.4 .4 \pi .5 . \pi / 6-\sqrt{3}+1$. 6. $\pi^2 / 4-2$. 7. $e-2$. $\quad 8.2 \pi / 3-\ln \operatorname{tg}(5 \pi / 12)$. $9.3\left(e^{\pi}-1\right) / 5$. 10. $\left(e^{\pi / 2}-1\right) / 2$.

## 8.3. Integration of Expressions $R(\sin x, \cos x)$

Problem Statement. Compute the definite integral

$$
\int_{a}^{b} R(\sin x, \cos x) \, dx
$$

where $R$ is a rational function of two variables.

Plan of Solution.

1. If $a$ and $b$ are such that the function $\operatorname{tg}(x / 2)$ is defined on $[a, b]$, then using the substitution

$$
t=\operatorname{tg} \frac{x}{2}
$$

integrals of functions $R(\sin x, \cos x)$ can be reduced to integrals of rational functions of the new variable $t$. Indeed, substituting into the integrand

$$
\sin x=\frac{2 t}{1+t^2}, \quad \cos x=\frac{1-t^2}{1+t^2}, \quad dx=\frac{2}{1+t^2} \, dt
$$

we get

$$
R(\sin x, \cos x) \, dx = R\left(\frac{2 t}{1+t^2}, \frac{1-t^2}{1+t^2}\right) \frac{2}{1+t^2} \, dt = R_1(t) \, dt
$$

The substitution $t=\operatorname{tg}(x / 2)$ is called universal.

2. Find the new limits of integration

$$
\alpha=\operatorname{tg} \frac{a}{2}, \quad \beta=\operatorname{tg} \frac{b}{2}
$$

3. Apply the formula for change of variables in a definite integral

$$
\int_{a}^{b} R(\sin x, \cos x) \, dx = \int_{\alpha}^{\beta} R\left(\frac{2 t}{1+t^2}, \frac{1-t^2}{1+t^2}\right) \frac{2}{1+t^2} \, dt
$$

4. Compute the antiderivative of the rational function $t$ and apply the Newton-Leibniz formula.

Remark. If the integrand has a special form, it is better to use substitutions that require fewer calculations:

a) If $R(\sin x, \cos x) = R_1(\sin x, \cos^2 x) \cos x$, then use the substitution $t = \sin x$. Indeed, the integrand becomes

$$
R_1(\sin x, \cos^2 x) \cos x \, dx = R_1(t, 1-t^2) \, dt
$$

b) If $R(\sin x, \cos x) = R_2(\sin^2 x, \cos x) \sin x$, then use the substitution $t = \cos x$. Indeed, the integrand becomes

$$
R_2(\sin^2 x, \cos x) \sin x \, dx = -R_2(1-t^2, t) \, dt
$$

c) If $R(\sin x, \cos x) = R_3(\operatorname{tg} x)$, then use the substitution $t = \operatorname{tg} x$ (provided that the function $\operatorname{tg} x$ is defined on $[a, b]$). Indeed, the integrand becomes

$$
R_3(\operatorname{tg} x) \, dx = R_3(t) \frac{1}{1+t^2} \, dt
$$