Given \frac{\mathrm{d} y}{\mathrm{~d} x}=\cos x-x, \text { find } y .
We need to find a function which, when differentiated, yields \cos x − x. Differentiating sin x yields \cos x, while differentiating −x²/2 yields −x. Hence,
y=\int(\cos x-x) \mathrm{d} x=\sin x-\frac{x^2}{2}+c
where c is the constant of integration. Usually brackets are not used and the integral is written simply as \int \cos x-x d x.