# Indefinite Integral of $-\sin(-x+2)$ does not match the derivative

I can get the solution but somewhere I am going wrong. Can't figure out where. We have to solve: $$\int -\sin(-x+2) \, dx$$

Here is my step by step solution using $u$-substitution:

$$u = -x + 2 \iff du = -dx$$

$$\int -\sin(-x+2) \, dx \iff \int \sin(-x+2) \, (-dx ) \iff \int \sin(u) \, du$$

Since $\frac{d}{dx} \cos(x) = -\sin(x)$,

$$\int \sin(u) \, du \iff -\cos(u) + C \iff -\cos(-x+2) + C$$

Which seems to be the solution. Now if I differentiate it then I should get back the integral but I don't.

$$\frac{d}{dx} (-\cos(-x+2) + C) \iff -\sin(-x+2) \, (-1)$$

$\sin(-x+2)$ which is not equal to where we started from $-\sin(-x+2)$. Am I missing something ?

• when you are taking derivative in the last step, there will be one more $-$ sign. Derivative of cosine is $-\sin$. – Anurag A Sep 14 '18 at 5:12
• $\frac{d}{dx}\left(-\cos(-x + 2)\right) = -\frac{d}{dx}\left(\cos(-x + 2)\right) = -(-\sin(-x+2)(-1)) = -\sin(-x+2)$ – Lucas Corrêa Sep 14 '18 at 5:13
• may be I am working too much and need a break. Just missed a simple thing :( – Arnuld Sep 14 '18 at 5:18

$$\frac{d}{dx}\cos(x) = -\sin(x),$$
• Proper notation is $\sin(x)$ or $\sin x,$ not $sin(x).$ I edited accordingly. – Michael Hardy Sep 14 '18 at 16:27
$$I=\int\sin(-x+2)dx$$ $u=-x+2$ so $dx=-du$ $$I=-\int\sin(u)du=\cos(u)+C=cos(-x+2)+C$$ now $$\frac{d}{dx}\left[\cos(-x+2)\right]=-\sin(-x+2)*\frac{d}{dx}\left[-x+2\right]=\sin(-x+2)$$