How to integrate $\int 2xe^{x^2-y^2}\cos(2xy)- 2ye^{x^2-y^2}\sin(2xy) \ \mathrm dy$? Find the value of:
$$\int 2xe^{x^2-y^2}\cos(2xy)- 2ye^{x^2-y^2}\sin(2xy) \ \mathrm dy$$
i have tried using integration by parts but it doesn't seem to work. How would I go about this integral ?
 A: Since 
$$  \frac{d}{dy}\left[e^{x^2-y^2}\sin(2xy)\right]=- 2ye^{x^2-y^2}\sin(2xy)+2xe^{x^2-y^2}\cos(2xy)$$
then
$$ \int 2xe^{x^2-y^2}\cos(2xy)- 2ye^{x^2-y^2}\sin(2xy)\,dy= e^{x^2-y^2}\sin(2xy)+c$$
Note: Because of the fact that the integrand appeared to be the result of application of the product rule for derivatives, it seemed appropriate to investigate the possibility.
A: $$\int \left(2xe^{x^2-y^2}\cos 2xy - 2ye^{x^2-y^2}\sin 2xy\right) \, dy = \int 2xe^{x^2-y^2} \cos 2xy \, dy - \int 2ye^{x^2-y^2} \sin 2xy \, dy $$
Let's integrate that first one on the RHS by parts.  We'll take $u = e^{x^2-y^2}$.  So then $du = -2ye^{x^2-y^2} \, dy$, $dv = 2x \cos 2xy \, dy$, and $v = \sin 2xy$.  (It may not be clear at first, but note that $v$ can easily be obtained from $dv$ with a simple substitution integral.  Substitute $t = 2xy$ into $\int 2x \cos 2xy \, dy$ to get $v = \sin 2xy$.)
With integration by parts, we have
\begin{align*}
  \int 2xe^{x^2-y^2} \cos2xy \, dy &= e^{x^2-y^2}\sin 2xy - \int \sin (2xy) \cdot \left(-2y e^{x^2-y^2}\right) \, dy\\[0.3cm]
    &= e^{x^2-y^2}\sin 2xy + \int 2y e^{x^2-y^2} \sin 2xy \, dy\\[0.3cm]
\end{align*}
Now use this with the very first line of my post to get a great cancellation, giving you the desired result immediately.
