Integral of $$$\sin{\left(x \right)} - \cos{\left(x \right)}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \left(\sin{\left(x \right)} - \cos{\left(x \right)}\right)\, dx$$$.
Solution
Integrate term by term:
$${\color{red}{\int{\left(\sin{\left(x \right)} - \cos{\left(x \right)}\right)d x}}} = {\color{red}{\left(\int{\sin{\left(x \right)} d x} - \int{\cos{\left(x \right)} d x}\right)}}$$
The integral of the cosine is $$$\int{\cos{\left(x \right)} d x} = \sin{\left(x \right)}$$$:
$$\int{\sin{\left(x \right)} d x} - {\color{red}{\int{\cos{\left(x \right)} d x}}} = \int{\sin{\left(x \right)} d x} - {\color{red}{\sin{\left(x \right)}}}$$
The integral of the sine is $$$\int{\sin{\left(x \right)} d x} = - \cos{\left(x \right)}$$$:
$$- \sin{\left(x \right)} + {\color{red}{\int{\sin{\left(x \right)} d x}}} = - \sin{\left(x \right)} + {\color{red}{\left(- \cos{\left(x \right)}\right)}}$$
Therefore,
$$\int{\left(\sin{\left(x \right)} - \cos{\left(x \right)}\right)d x} = - \sin{\left(x \right)} - \cos{\left(x \right)}$$
Simplify:
$$\int{\left(\sin{\left(x \right)} - \cos{\left(x \right)}\right)d x} = - \sqrt{2} \sin{\left(x + \frac{\pi}{4} \right)}$$
Add the constant of integration:
$$\int{\left(\sin{\left(x \right)} - \cos{\left(x \right)}\right)d x} = - \sqrt{2} \sin{\left(x + \frac{\pi}{4} \right)}+C$$
Answer
$$$\int \left(\sin{\left(x \right)} - \cos{\left(x \right)}\right)\, dx = - \sqrt{2} \sin{\left(x + \frac{\pi}{4} \right)} + C$$$A