# Using asymptotic expansion of integral

What is the best method to get an Asymptotic expansion of integral of $$\int \frac{\ln(a-x)}{\ln(a+x)} \, dx$$?

or as definite integral $$\int_{-a+2}^{a-2} \frac{\ln(a-x)}{\ln(a+x)} \, dx$$?

Similar integral $$\operatorname{Li}(x)$$ where there is no closed form is successfully found using Asymptotic expansion by integration by parts or by repeated partial integration logarithmic integral function and asymptotic expansion. But I cannot seem to get that to work see below.

Edit: this approach does not lead to anything useful as the $$\operatorname{Li}(x)$$ function tends to undermine any hope of partial integration. Therefore are there any other asymptotic expansion methods that would be more suitable? Power series is not very accurate even with many expanded powers. FIRST ATTEMPT:

I'm not sure what is the cause of the problem in my workings:

# $$1$$

$$\int \frac{\ln(a-x)}{\ln(a+x)} \, dx$$

using $$v=\ln(a-x)$$, $$dv=-\frac{1}{a-x}$$, $$du=\frac{1}{\ln(a+x)}$$,$$u=\operatorname{Li}(a+x)$$

$$\operatorname{Li}(a+x)\ln(a-x)+\int \frac{\operatorname{Li}(a+x)}{a-x} \, dx$$

so far so good.

# $$2$$

now repeating for $$\int \frac{\operatorname{Li}(a+x)}{a-x} \, dx$$

using $$v=\operatorname{Li}(a+x)$$, $$dv=\frac{1}{\ln(a+x)}$$, $$du=\frac{1}{a-x}$$, $$u=-\ln(a-x)$$

$$-\operatorname{Li}(a+x)\ln(a-x)+\int \frac{\ln(a-x)}{\ln(a+x)} \, dx$$

# $$3$$

Collecting altogether results in the disaster

$$\int \frac{\ln(a-x)}{\ln(a+x)} \, dx=(\operatorname{Li}(a+x)\ln(a-x))-(\operatorname{Li}(a+x)\ln(a-x))+\int \frac{\ln(a-x)}{\ln(a+x)} \, dx$$

• Your 2 undoes the work of 1, to get further you'd need to keep differentiating/integrating the same factors, so $v = \frac{1}{a-x}$, $dv = \frac{1}{(a-x)^2}$, $du = \operatorname{li}(a+x)$, and $u = \text{ugh}$. Do you want an asymptotic expansion for $x \to +\infty$ or something else? Jun 7 '18 at 15:04
• @Daniel Fischer I've added a second question to make it a definite integral with limits shown. Sorry what is $u = \text{ugh}$? Jun 7 '18 at 15:09
• A primitive of the logarithmic integral isn't the most pretty of all functions. $\text{ugh}$ may be an exaggeration, but a couple of steps further it becomes justified. Jun 7 '18 at 15:25
• ugh, I see, I tend to agree! there are other asymptotic expansion methods using a simple power series expansion is not very accurate with 30 terms though. Jun 7 '18 at 15:31

Use the abbreviation $$L=\log{2}$$ and $$L_n = \log^n{2}.$$ Then an asymptotic approximation for $$a \to \infty$$ is $$I(a):=\int_{2-a}^{2+a} \frac{\log{(a-x)}}{\log{(a+x)}} dx \sim L \, \big( \text{ li}(2(a-1)) - \text{li}(2) \,\big) \, +$$ $$+ 2a\Big(1-\frac{L}{\log{a}} - \frac{1}{\log^2{a}}\big(L-L_2-\zeta(2) \big) - \frac{1}{\log^3{a}}\big(2L-2L_2+L_3+2(L-1)\zeta(2)-2\zeta(3)\big)+... \Big)$$ where li(x) is the logarithmic integral (LogIntegral[x] in Mathematica) and has its own well-known asymptotic expansion. To develop this expansion, shift and scale the defining integral for $$I(a)$$ to obtain $$I(a)=2\int_1^{a-1} \frac{\log{2(a-x)}}{\log{(2x)}} dx = 2L\int_1^{a-1}\frac{dx}{\log{(2x)}}+2\int_1^{a-1} \frac{\log{(a-x)}}{\log{(2x)}}dx.$$ The first integral can be solve in terms of the logarithmic integral. The remaining integral is solved in an asymptotic expansion in inverse powers of $$\log{a}.$$ $$J(a):=\int_1^{a-1} \frac{\log{(a-x)}}{\log{(2x)}}dx=a \int_{1/a}^{1-1/a} \frac{\log{a} + \log{(1-x)}}{\log{a} + \log{(2x)}}dx=$$ $$a\int_{1/a}^{1-1/a} \Big( 1+ \frac{\log{(1-x)}-\log{2x} }{\log{a}} - \log{(2x)}\frac{\log{(1-x)}-\log{2x} }{\log^2{a}} + ...\Big).$$ The first integral can be explicitly done and its value is $$1-2/a.$$ The second integral can likewise be done and it evaluates to $$-L\cdot(1-2/a)/\log{a}.$$ At this point we notice that we shouldn't keep terms involving $$1/a$$ because they are exponentially small compared to terms involving $$1/\log^n{a}.$$ The third term can also be explicitly solved but the expression involves the dilogarithm. Rather than use such an unwieldy expression, it too is expanded as $$a \to \infty$$ and the compact expression seen in the answer results. The fourth term can also be handled in this manner.
For a numerical comparison, let $$a=1000.$$ The (e)xplicit integral gives a value of $$I_e(10^3)=2107.8$$. The (a)pproximation to second order, i.e., including the $$1/\log^2{a}$$ in the second line of the answer, yields $$I_a^{(2)}= 2076.7$$ for an error of 1.48%. The approximation to all given terms in the second line of the answer yields $$I_a^{(3)}= 2092.8$$ for an error of 0.71%