Integral of $$$\left(- \sin{\left(\frac{x}{2} \right)} + \cos{\left(\frac{x}{2} \right)}\right)^{2}$$$

The calculator will find the integral/antiderivative of $$$\left(- \sin{\left(\frac{x}{2} \right)} + \cos{\left(\frac{x}{2} \right)}\right)^{2}$$$, with steps shown.

Related calculator: Definite and Improper Integral Calculator

Please write without any differentials such as $$$dx$$$, $$$dy$$$ etc.
Leave empty for autodetection.

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please contact us.

Your Input

Find $$$\int \left(- \sin{\left(\frac{x}{2} \right)} + \cos{\left(\frac{x}{2} \right)}\right)^{2}\, dx$$$.

Solution

Let $$$u=\frac{x}{2}$$$.

Then $$$du=\left(\frac{x}{2}\right)^{\prime }dx = \frac{dx}{2}$$$ (steps can be seen »), and we have that $$$dx = 2 du$$$.

The integral becomes

$${\color{red}{\int{\left(- \sin{\left(\frac{x}{2} \right)} + \cos{\left(\frac{x}{2} \right)}\right)^{2} d x}}} = {\color{red}{\int{\left(2 - 2 \sin{\left(2 u \right)}\right)d u}}}$$

Apply the constant multiple rule $$$\int c f{\left(u \right)}\, du = c \int f{\left(u \right)}\, du$$$ with $$$c=2$$$ and $$$f{\left(u \right)} = 1 - \sin{\left(2 u \right)}$$$:

$${\color{red}{\int{\left(2 - 2 \sin{\left(2 u \right)}\right)d u}}} = {\color{red}{\left(2 \int{\left(1 - \sin{\left(2 u \right)}\right)d u}\right)}}$$

Integrate term by term:

$$2 {\color{red}{\int{\left(1 - \sin{\left(2 u \right)}\right)d u}}} = 2 {\color{red}{\left(\int{1 d u} - \int{\sin{\left(2 u \right)} d u}\right)}}$$

Apply the constant rule $$$\int c\, du = c u$$$ with $$$c=1$$$:

$$- 2 \int{\sin{\left(2 u \right)} d u} + 2 {\color{red}{\int{1 d u}}} = - 2 \int{\sin{\left(2 u \right)} d u} + 2 {\color{red}{u}}$$

Let $$$v=2 u$$$.

Then $$$dv=\left(2 u\right)^{\prime }du = 2 du$$$ (steps can be seen »), and we have that $$$du = \frac{dv}{2}$$$.

Therefore,

$$2 u - 2 {\color{red}{\int{\sin{\left(2 u \right)} d u}}} = 2 u - 2 {\color{red}{\int{\frac{\sin{\left(v \right)}}{2} d v}}}$$

Apply the constant multiple rule $$$\int c f{\left(v \right)}\, dv = c \int f{\left(v \right)}\, dv$$$ with $$$c=\frac{1}{2}$$$ and $$$f{\left(v \right)} = \sin{\left(v \right)}$$$:

$$2 u - 2 {\color{red}{\int{\frac{\sin{\left(v \right)}}{2} d v}}} = 2 u - 2 {\color{red}{\left(\frac{\int{\sin{\left(v \right)} d v}}{2}\right)}}$$

The integral of the sine is $$$\int{\sin{\left(v \right)} d v} = - \cos{\left(v \right)}$$$:

$$2 u - {\color{red}{\int{\sin{\left(v \right)} d v}}} = 2 u - {\color{red}{\left(- \cos{\left(v \right)}\right)}}$$

Recall that $$$v=2 u$$$:

$$2 u + \cos{\left({\color{red}{v}} \right)} = 2 u + \cos{\left({\color{red}{\left(2 u\right)}} \right)}$$

Recall that $$$u=\frac{x}{2}$$$:

$$\cos{\left(2 {\color{red}{u}} \right)} + 2 {\color{red}{u}} = \cos{\left(2 {\color{red}{\left(\frac{x}{2}\right)}} \right)} + 2 {\color{red}{\left(\frac{x}{2}\right)}}$$

Therefore,

$$\int{\left(- \sin{\left(\frac{x}{2} \right)} + \cos{\left(\frac{x}{2} \right)}\right)^{2} d x} = x + \cos{\left(x \right)}$$

Add the constant of integration:

$$\int{\left(- \sin{\left(\frac{x}{2} \right)} + \cos{\left(\frac{x}{2} \right)}\right)^{2} d x} = x + \cos{\left(x \right)}+C$$

Answer

$$$\int \left(- \sin{\left(\frac{x}{2} \right)} + \cos{\left(\frac{x}{2} \right)}\right)^{2}\, dx = \left(x + \cos{\left(x \right)}\right) + C$$$A


Please try a new game Rotatly