So I have a very simple integral at hand which can be evaluated by parts directly, and the answer so obtained matches with the correct antiderivative.
$$\int e^{-x}\sin x\mathrm dx$$
My question arises when I try to use the formula for integrals of the type $\int e^{ax}\sin(bx+c)\mathrm dx$. Although the formula itself is derived from two applications of by parts technique, the result finally obtained for the said integral differs in sign. Here's how:
$$\begin{aligned}\int e^{ax}\sin (bx+c)\mathrm dx &= \frac{e^{ax}}{a^2+b^2}\left(a\sin(bx+c)-b\cos(bx+c)\right)\\ & = \frac{e^{ax}}{r}\sin(bx+c-\phi) \ , \ r=\sqrt{a^2+b^2} \ , \ \phi=\arctan\left(\frac{b}{a}\right)\end{aligned}$$
Plugging in $a=-1$, $b=1$ and $c=0$ for the integral at hand gives $1/\sqrt{2}\cdot \sin(x+\pi/4)$ which is negative of the correct antiderivative. What mistake am I making? Any pointers are appreciated. Thanks.