# Use Taylor Series Expansion in Calculating Integral

I want to approximate this integral: $$I = \int_0^\infty {{e^{ - bx}}\ln \left( {{a_1}{e^{ - {b_1}x}} + {a_2}{e^{ - {b_2}x}}} \right)dx}$$ where $b,{a_1},{a_2},{b_1},{b_2} > 0$ and $b_2>b_1$. Here is my answer:

We can observe that there exists a constant $c$ so that if $x>c$, then $\frac{{{a_2}}}{{{a_1}}}{e^{ - \left( {{b_2} - {b_1}} \right)x}} \in \left( {0,1} \right)$; and if $0 \le x \le c$, then $\frac{{{a_1}}}{{{a_2}}}{e^{ - \left( {{b_1} - {b_2}} \right)x}} \in \left( {0,1} \right]$. Actually the value of $c$ is: $$c = \frac{{\ln \left( {{a_1}/{a_2}} \right)}}{{{b_1} - {b_2}}}$$ Using the Taylor Series Expansion $\ln \left( {1 + y} \right) = \sum\limits_{n = 1}^\infty {{{\left( { - 1} \right)}^{n - 1}}\frac{{{y^n}}}{n}}$ with $y \in \left( {0,1} \right)$, we obtain: $$\begin{array}{l} I = - \left( {\ln {a_1} - {b_1}} \right)\frac{{{e^{ - bc}}\left( {b + 1} \right)}}{{{b^2}}} + \sum\limits_{n = 1}^\infty {\frac{{{{\left( { - 1} \right)}^{n - 1}}}}{n}\int_c^\infty {{e^{ - bx}}{{\left( {\frac{{{a_2}}}{{{a_1}}}} \right)}^n}{e^{ - n\left( {{b_2} - {b_1}} \right)x}}dx} } \\ - \left( {\ln {a_2} - {b_2}} \right)\frac{{\left( {1 - {e^{ - bc}}} \right)\left( {b + 1} \right)}}{{{b^2}}} + \sum\limits_{n = 1}^\infty {\frac{{{{\left( { - 1} \right)}^{n - 1}}}}{n}\int_0^c {{e^{ - bx}}{{\left( {\frac{{{a_1}}}{{{a_2}}}} \right)}^n}{e^{ - n\left( {{b_1} - {b_2}} \right)x}}dx} } \\ = - \left( {\ln {a_1} - {b_1}} \right)\frac{{{e^{ - bc}}\left( {b + 1} \right)}}{{{b^2}}} + \sum\limits_{n = 1}^\infty {\frac{{{{\left( { - 1} \right)}^{n - 1}}}}{n}{{\left( {\frac{{{a_2}}}{{{a_1}}}} \right)}^n}\frac{{{e^{ - \left[ {n\left( {{b_2} - {b_1}} \right) + b} \right]c}}}}{{\left[ {n\left( {{b_2} - {b_1}} \right) + b} \right]}}} \\ - \left( {\ln {a_2} - {b_2}} \right)\frac{{\left( {1 - {e^{ - bc}}} \right)\left( {b + 1} \right)}}{{{b^2}}} + \sum\limits_{n = 1}^\infty {\frac{{{{\left( { - 1} \right)}^{n - 1}}}}{n}{{\left( {\frac{{{a_1}}}{{{a_2}}}} \right)}^n}\frac{{1 - {e^{ - \left[ {n\left( {{b_1} - {b_2}} \right) + b} \right]c}}}}{{\left[ {n\left( {{b_1} - {b_2}} \right) + b} \right]}}} \\ = - \frac{{\left( {b + 1} \right)}}{{{b^2}}}\left[ {\left( {\ln {a_1} - {b_1}} \right){e^{ - bc}} + \left( {\ln {a_2} - {b_2}} \right)\left( {1 - {e^{ - bc}}} \right)} \right]\\ + \sum\limits_{n = 1}^\infty {\frac{{{{\left( { - 1} \right)}^{n - 1}}}}{n}\left( {{{\left( {\frac{{{a_2}}}{{{a_1}}}} \right)}^n}\frac{{{e^{ - \left[ {n\left( {{b_2} - {b_1}} \right) + b} \right]c}}}}{{\left[ {n\left( {{b_2} - {b_1}} \right) + b} \right]}} + {{\left( {\frac{{{a_1}}}{{{a_2}}}} \right)}^n}\frac{{1 - {e^{ - \left[ {n\left( {{b_1} - {b_2}} \right) + b} \right]c}}}}{{\left[ {n\left( {{b_1} - {b_2}} \right) + b} \right]}}} \right)} \end{array}$$ Since $\frac{{{a_2}}}{{{a_1}}}{e^{ - \left( {{b_2} - {b_1}} \right)c}} = \frac{{{a_1}}}{{{a_2}}}{e^{ - \left( {{b_1} - {b_2}} \right)c}} = 1$, we get $$\begin{array}{l} I = - \frac{{\left( {b + 1} \right)}}{{{b^2}}}\left[ {\left( {\ln {a_1} - {b_1}} \right){e^{ - bc}} + \left( {\ln {a_2} - {b_2}} \right)\left( {1 - {e^{ - bc}}} \right)} \right]\\ + \sum\limits_{n = 1}^\infty {\frac{{{{\left( { - 1} \right)}^{n - 1}}}}{n}\left( {\frac{{{e^{ - bc}}}}{{\left[ {n\left( {{b_2} - {b_1}} \right) + b} \right]}} + \frac{{{{\left( {\frac{{{a_1}}}{{{a_2}}}} \right)}^n} - {e^{ - bc}}}}{{\left[ {n\left( {{b_1} - {b_2}} \right) + b} \right]}}} \right)} \end{array}$$ Is that result converged?

-
You've made a mistake somewhere. $I$ should not depend on $x$, but the expression in the last line does. – Vibert Jan 16 '13 at 18:41
Always exercise caution when attempting to use a power series to solve an improper integral. You can ordinarily get away with such tricks in the event that the bounds of integration are finite, for instance, because an analytic function is the uniform limit of its power series on any compact interval. To do the same for an improper integral might require a truncation argument. – A Blumenthal Jan 16 '13 at 18:45
Also, the series you wrote down (incorrect as it may be, since it should not depend on the integration parameter) does not converge unless $a_1 = a_2$, as otherwise either of the terms $(a_1/a_2)^n$ or its reciprocal will blow up geometrically, and the decay you have in $n$ is only like $n^{-2}$. – A Blumenthal Jan 16 '13 at 18:47
I edited my answer to be clearer and fixed the typos. Those 2 Taylor Series are definitely converged. But it is not sure for the final result. – widapol Jan 16 '13 at 19:06

Substitution and repeated integration by parts yields $$\int_0^\infty x^ne^{-kx}\mathrm{d}x=\frac{n!}{k^{n+1}}$$

Assume $b_1\le b_2$ and $|a_2|\le|a_1|$, but not both equal, then \begin{align} &\int_0^\infty e^{-bx}\log\left(a_1e^{-b_1x}+a_2e^{-b_2x}\right)\mathrm{d}x\\ &=\int_0^\infty e^{-bx}\left(\log(a_1)-b_1x+\log\left(1+\frac{a_2}{a_1}e^{-(b_2-b_1)x}\right)\right)\mathrm{d}x\\ &=\frac{\log(a_1)}{b}-\frac{b_1}{b^2}+\int_0^\infty e^{-bx}\log\left(1+\frac{a_2}{a_1}e^{-(b_2-b_1)x}\right)\mathrm{d}x\\ &=\frac{\log(a_1)}{b}-\frac{b_1}{b^2}+\int_0^\infty\left(\color{#C00000}{\sum_{k=1}^\infty(-1)^{k-1}\frac1k\frac{a_2^k}{a_1^k}e^{-(b+k(b_2-b_1))x}}\right)\mathrm{d}x\\ &=\frac{\log(a_1)}{b}-\frac{b_1}{b^2}+\sum_{k=1}^\infty(-1)^{k-1}\frac1k\frac{a_2^k}{a_1^k}\frac1{b+k(b_2-b_1)}\\ \end{align} where the series in red is derived from the Taylor series for $\log(1+x)$.

-