Integral of $$$- x + \cos{\left(x \right)}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \left(- x + \cos{\left(x \right)}\right)\, dx$$$.
Solution
Integrate term by term:
$${\color{red}{\int{\left(- x + \cos{\left(x \right)}\right)d x}}} = {\color{red}{\left(- \int{x d x} + \int{\cos{\left(x \right)} d x}\right)}}$$
Apply the power rule $$$\int x^{n}\, dx = \frac{x^{n + 1}}{n + 1}$$$ $$$\left(n \neq -1 \right)$$$ with $$$n=1$$$:
$$\int{\cos{\left(x \right)} d x} - {\color{red}{\int{x d x}}}=\int{\cos{\left(x \right)} d x} - {\color{red}{\frac{x^{1 + 1}}{1 + 1}}}=\int{\cos{\left(x \right)} d x} - {\color{red}{\left(\frac{x^{2}}{2}\right)}}$$
The integral of the cosine is $$$\int{\cos{\left(x \right)} d x} = \sin{\left(x \right)}$$$:
$$- \frac{x^{2}}{2} + {\color{red}{\int{\cos{\left(x \right)} d x}}} = - \frac{x^{2}}{2} + {\color{red}{\sin{\left(x \right)}}}$$
Therefore,
$$\int{\left(- x + \cos{\left(x \right)}\right)d x} = - \frac{x^{2}}{2} + \sin{\left(x \right)}$$
Add the constant of integration:
$$\int{\left(- x + \cos{\left(x \right)}\right)d x} = - \frac{x^{2}}{2} + \sin{\left(x \right)}+C$$
Answer
$$$\int \left(- x + \cos{\left(x \right)}\right)\, dx = \left(- \frac{x^{2}}{2} + \sin{\left(x \right)}\right) + C$$$A