Integral of $$$\cot^{2}{\left(x + \frac{\pi}{4} \right)}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \cot^{2}{\left(x + \frac{\pi}{4} \right)}\, dx$$$.
Solution
Let $$$u=x + \frac{\pi}{4}$$$.
Then $$$du=\left(x + \frac{\pi}{4}\right)^{\prime }dx = 1 dx$$$ (steps can be seen »), and we have that $$$dx = du$$$.
So,
$${\color{red}{\int{\cot^{2}{\left(x + \frac{\pi}{4} \right)} d x}}} = {\color{red}{\int{\cot^{2}{\left(u \right)} d u}}}$$
Let $$$v=\cot{\left(u \right)}$$$.
Then $$$dv=\left(\cot{\left(u \right)}\right)^{\prime }du = - \csc^{2}{\left(u \right)} du$$$ (steps can be seen »), and we have that $$$\csc^{2}{\left(u \right)} du = - dv$$$.
The integral can be rewritten as
$${\color{red}{\int{\cot^{2}{\left(u \right)} d u}}} = {\color{red}{\int{\left(- \frac{v^{2}}{v^{2} + 1}\right)d v}}}$$
Apply the constant multiple rule $$$\int c f{\left(v \right)}\, dv = c \int f{\left(v \right)}\, dv$$$ with $$$c=-1$$$ and $$$f{\left(v \right)} = \frac{v^{2}}{v^{2} + 1}$$$:
$${\color{red}{\int{\left(- \frac{v^{2}}{v^{2} + 1}\right)d v}}} = {\color{red}{\left(- \int{\frac{v^{2}}{v^{2} + 1} d v}\right)}}$$
Rewrite and split the fraction:
$$- {\color{red}{\int{\frac{v^{2}}{v^{2} + 1} d v}}} = - {\color{red}{\int{\left(1 - \frac{1}{v^{2} + 1}\right)d v}}}$$
Integrate term by term:
$$- {\color{red}{\int{\left(1 - \frac{1}{v^{2} + 1}\right)d v}}} = - {\color{red}{\left(\int{1 d v} - \int{\frac{1}{v^{2} + 1} d v}\right)}}$$
Apply the constant rule $$$\int c\, dv = c v$$$ with $$$c=1$$$:
$$\int{\frac{1}{v^{2} + 1} d v} - {\color{red}{\int{1 d v}}} = \int{\frac{1}{v^{2} + 1} d v} - {\color{red}{v}}$$
The integral of $$$\frac{1}{v^{2} + 1}$$$ is $$$\int{\frac{1}{v^{2} + 1} d v} = \operatorname{atan}{\left(v \right)}$$$:
$$- v + {\color{red}{\int{\frac{1}{v^{2} + 1} d v}}} = - v + {\color{red}{\operatorname{atan}{\left(v \right)}}}$$
Recall that $$$v=\cot{\left(u \right)}$$$:
$$\operatorname{atan}{\left({\color{red}{v}} \right)} - {\color{red}{v}} = \operatorname{atan}{\left({\color{red}{\cot{\left(u \right)}}} \right)} - {\color{red}{\cot{\left(u \right)}}}$$
Recall that $$$u=x + \frac{\pi}{4}$$$:
$$- \cot{\left({\color{red}{u}} \right)} + \operatorname{atan}{\left(\cot{\left({\color{red}{u}} \right)} \right)} = - \cot{\left({\color{red}{\left(x + \frac{\pi}{4}\right)}} \right)} + \operatorname{atan}{\left(\cot{\left({\color{red}{\left(x + \frac{\pi}{4}\right)}} \right)} \right)}$$
Therefore,
$$\int{\cot^{2}{\left(x + \frac{\pi}{4} \right)} d x} = - \cot{\left(x + \frac{\pi}{4} \right)} + \operatorname{atan}{\left(\cot{\left(x + \frac{\pi}{4} \right)} \right)}$$
Add the constant of integration:
$$\int{\cot^{2}{\left(x + \frac{\pi}{4} \right)} d x} = - \cot{\left(x + \frac{\pi}{4} \right)} + \operatorname{atan}{\left(\cot{\left(x + \frac{\pi}{4} \right)} \right)}+C$$
Answer
$$$\int \cot^{2}{\left(x + \frac{\pi}{4} \right)}\, dx = \left(- \cot{\left(x + \frac{\pi}{4} \right)} + \operatorname{atan}{\left(\cot{\left(x + \frac{\pi}{4} \right)} \right)}\right) + C$$$A