# Another difficult 2D trigonometric integral

This is a follow-up question to A difficult 2d trigonometric integral. Unfortunately, I had a mistake in my calculations and I need a different (yet similar) seemingly simple integral solved:

$$\int_{a}^{b}\int_{a}^{y}\frac{\sin(x-y)}{xy}\mathop{\mathrm{d}x}\mathop{\mathrm{d}y}$$

For some $$0. The same methods as before can not be applied here, and I've been sitting for hours trying to solve this. Solutions (also using $$\mathop{\mathrm{Si}}$$ & $$\mathop{\mathrm{Ci}}$$ functions) would be very-very-very appreciated.

Thanks!

First, use the identity $$\sin (x-y)=\sin x \cos y - \cos x \sin y$$, and the sum rule to get $$\int_a^b\left[\int_a^y\frac{\sin x\cos y}{xy}\mathrm{d}x-\int_a^y\frac{\cos x\sin y}{xy} \mathrm{d}x \right]\mathrm{d}y$$ Pull out the constants and you get $$\int_a^b\left[ \frac{\cos{y}}{y}\int_a^y\frac{\sin x}{x}\mathrm{d}x-\frac{\sin y}{y}\int_a^y\frac{\cos x}{x}\mathrm{d}x \right]\mathrm{d}y$$

This simplifies to $$\int_a^b\left[\frac{\cos y}{y}\Bigr[\mathrm{Si}(x)\Bigr]_a^y-\frac{\sin y}{y}\Bigr[\mathrm{Ci}(x)\Bigr]_a^y\right]\mathrm{d}y$$

$$\int_a^b\left[\frac{\cos y}{y}\Bigr(\mathrm{Si}(y)-\mathrm{Si}(a)\Bigr)-\frac{\sin y}{y}\Bigr(\mathrm{Ci}(y)-\mathrm{Ci}(a)\Bigr)\right]\mathrm{d}y$$

$$\int_a^b\left[\frac{\mathrm{Si}(y)\cos y}{y}-\frac{\mathrm{Si}(a)\cos y}{y}-\frac{\mathrm{Ci}(y)\sin y}{y}+\frac{\mathrm{Ci}(a)\sin y}{y}\right]\mathrm{d}y$$

$$\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y-\int_a^b\frac{\mathrm{Si}(a)\cos y}{y}\mathrm{d}y-\int_a^b\frac{\mathrm{Ci}(y)\sin y}{y}\mathrm{d}y+\int_a^b\frac{\mathrm{Ci}(a)\sin y}{y}\mathrm{d}y$$

$$\mathrm{Si}(a)$$ and $$\mathrm{Ci}(a)$$ are constants, so they come out of their respective integrals, which further simplify. $$\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y-\mathrm{Si}(a)\int_a^b\frac{\cos y}{y}\mathrm{d}y-\int_a^b\frac{\mathrm{Ci}(y)\sin y}{y}\mathrm{d}y+\mathrm{Ci}(a)\int_a^b\frac{\sin y}{y}\mathrm{d}y$$

$$\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y-\mathrm{Si}(a)\Bigr[\mathrm{Ci}(y)\Bigr]_a^b-\int_a^b\frac{\mathrm{Ci}(y)\sin y}{y}\mathrm{d}y+\mathrm{Ci}(a)\Bigr[\mathrm{Si}(y)\Bigr]_a^b$$

$$\mathrm{Si}(a)\mathrm{Ci}(a)-\mathrm{Si}(a)\mathrm{Ci}(b)+\mathrm{Si}(b)\mathrm{Ci}(a)-\mathrm{Si}(a)\mathrm{Ci}(a)+\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y-\int_a^b\frac{\mathrm{Ci}(y)\sin y}{y}\mathrm{d}y$$

$$\mathrm{Si}(b)\mathrm{Ci}(a)-\mathrm{Si}(a)\mathrm{Ci}(b)+\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y-\int_a^b\frac{\mathrm{Ci}(y)\sin y}{y}\mathrm{d}y$$

Using integration by parts, we can transform $$-\int_a^b\frac{\mathrm{Ci}(y)\sin y}{y}\mathrm{d}y$$ into the other integral. $$-\int_a^b\frac{\mathrm{Ci}(y)\sin y}{y}\mathrm{d}y = -\Bigr[\mathrm{Si}(y)\mathrm{Ci}(y)\Bigr]_a^b+\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y$$

Substituting, we get $$\mathrm{Si}(b)\mathrm{Ci}(a)-\mathrm{Si}(a)\mathrm{Ci}(b)+\mathrm{Si}(a)\mathrm{Ci}(a)-\mathrm{Si}(b)\mathrm{Ci}(b)+2\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y$$

$$\big(\mathrm{Si}(a)+\mathrm{Si}(b)\big)\big(\mathrm{Ci}(a)-\mathrm{Ci}(b)\big)+2\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}$$

Now, to the best of my knowledge, that integral has no elementary solution. After laboring over it, I finally ran it through Maxima, which uses the Risch Algorithm, and it got nothing as well. However, we can expand the sine integral as a convergent infinite series (source: [Wikipedia][1]), and then solve the integral from there. $$\mathrm{Si}(y)=\sum_{n=0}^\infty\frac{(-1)^ny^{2n+1}}{(2n+1)(2n+1)!}$$ Substituting this in, we get $$2\int_a^b\frac{\mathrm{Si}(y)\cos y}{y}\mathrm{d}y=\sum_{n=0}^\infty\frac{2(-1)^n}{(2n+1)(2n+1)!}\int_a^b\frac{y^{2n-1}\cos y}{y}\mathrm{d}y$$ $$\sum_{n=0}^\infty\frac{2(-1)^n}{(2n+1)(2n+1)!}\int_a^b y^{2n}\cos y\,\mathrm{d}y$$ That integral is solvable, and can be found to be $$\int_a^b y^{2n}\cos y\,\mathrm{d}y=\Bigr[-\frac{1}{2}i^{2n+1}\big[\Gamma(2n+1,-ix)+(-1)^{2n}\Gamma(2n+1,ix)\big]\Bigr]_a^b$$ Plugging this in we get the final answer. $$-\sum_{n=0}^\infty\frac{i^{4n+1}}{(2n+1)(2n+1)!}\big[\Gamma(2n+1,-ib)+(-1)^{2n}\Gamma(2n+1,ib)-\Gamma(2n+1,-ia)-(-1)^{2n}\Gamma(2n+1,ia)\big]$$ $$\big(\mathrm{Si}(a)+\mathrm{Si}(b)\big)\big(\mathrm{Ci}(a)-\mathrm{Ci}(b)\big)-\sum_{n=0}^\infty\frac{i^{4n+1}}{(2n+1)(2n+1)!}\big[\Gamma(2n+1,-ib)+(-1)^{2n}\Gamma(2n+1,ib)-\Gamma(2n+1,-ia)-(-1)^{2n}\Gamma(2n+1,ia)\big]$$ I have it worked out without the incomplete Gamma function as a double sum. If you want me to write out that solution as well, leave a comment.

EDIT: Here's the solution involving infinite sums. Now, because n is discrete, I can describe the integral as an infinite sum. I solved the integrals for the cases $$n = 0$$, $$n=1$$, and $$n=2$$, and constructed the rule $$\int_a^b\frac{y^{2n-1}\cos y}{y}\mathrm{d}y=\left[\sum_{q=0}^{2n}(-1)^{q+1}\frac{2n!}{q!}\frac{\mathrm{d}^{q}\sin x}{\mathrm{d}x^{q}}x^q\right]_a^b$$ $$\sum_{q=0}^{2n}(-1)^{q+1}\frac{2n!}{q!}\frac{\mathrm{d}^{q}\sin b}{\mathrm{d}x^{q}}b^q-\sum_{q=0}^{2n}(-1)^{q+1}\frac{2n!}{q!}\frac{\mathrm{d}^{q}\sin a}{\mathrm{d}x^{q}}a^q$$ (I tested this for the case $$n=3$$, and it works fine). So, substituting this into the equation, we get $$\sum_{n=0}^\infty\left[\frac{2(-1)^n}{(2n+1)(2n+1)!}\left[\sum_{q=0}^{2n}\left[(-1)^{q+1}\frac{2n!}{q!}\frac{\mathrm{d}^{q}\sin x}{\mathrm{d}x^{q}}x^q\right]\right]_a^b\right]$$ $$\big(\mathrm{Si}(a)+\mathrm{Si}(b)\big)\big(\mathrm{Ci}(a)-\mathrm{Ci}(b)\big)+2\sum_{n=0}^\infty\left[\frac{2(-1)^n}{(2n+1)(2n+1)!}\left[\sum_{q=0}^{2n}\left[(-1)^{q+1}\frac{2n!}{q!}\frac{\mathrm{d}^{q}\sin x}{\mathrm{d}x^{q}}x^q\right]\right]_a^b\right]$$

• Thank you. I award you with the bounty. I would appreciate if you also wrote the other solution as well. – EZLearner Nov 25 '18 at 12:18
• No problem. I can type it up now. – Tesseract Nov 27 '18 at 1:50