# Power series for $\ln(1+x^2)$

In the problem I am asked to use a power series representation of $\ln(1+x)$ to approximate the integral from $0$ to $0.5$ of $\ln(1+x^2)$ to within 4 decimal places. So far I have found a series for $\ln(1+x^2)$ by manipulating the known series 1/(1-r)

$\ln (1+x)=x−x^2/2+(2x^3)/3−(3x^4)/4+(4x^5)/5 \cdots$

Substituting x for $x^2$ yields:

$\ln (1+(x^2 ))=(x^2 )−(x^2 )^2/2+(2(x^2 )^3)/3−(3(x^2 )^4)/4+(4(x^2 )^5)/5−…=x^2−x^4/2+(2x^6)/3−(3x^8)/4+(4x^{10})/5 - \cdots$

In order to determine accuracy I have to figure out how many terms to take and to figure this out I must be able to define a general term in the series. I have tried for several hours to determine the general terms, and the closest I have come to success is a general term which describes the entire series that I can imagine but not the first term. Something like:$\sum_{n=1}^∞ (−1)^n∙2(n^2+n) x^{2n+3})/(n+1)(2n+3)$

Can anybody tell if/where there is an error in my arithmetic/approach that is causing problems, and send me in the right direction? Or, if anybody knows of any standard procedure to obtain the general term from this point, this would be helpful as well.

• Some of your formatting got corrupted. It also really helps readability to format using MathJax (see FAQ). Regards – Amzoti Apr 1 '13 at 4:32
• Will fix ASAP. Thanks for the pointers. My last question I basicly just copied it in from OneNote and it worked. I will look into proper formatting procedure to post properly in the future. – Yak Attack Apr 1 '13 at 6:04
• Thanks for the edits @Halil Duru. – Yak Attack Apr 2 '13 at 1:11

The TeX is not entirely clear, and the answer obtained may not be correct. So we do the calculation. We start from the expansion $$\frac{1}{1+t}=1-t+t^2-t^3+ t^4-t^5+\cdots,$$ valid when $$|t|\lt 1$$. Integrating term by term we get $$\ln(1+t)=t-\frac{t^2}{2}+\frac{t^3}{3}-\frac{t^4}{4}+\frac{t^5}{5}-\cdots.$$ Mechanically replacing $$t$$ by $$x^2$$, we get $$\ln(1+x^2)=x^2-\frac{x^4}{2}+\frac{x^6}{3}-\frac{x^8}{4}+\frac{x^{10}}{5}-\cdots.$$ Integrating from $$0$$ to $$w$$, we get $$\int_0^w\ln(1+x^2)\,dx=\frac{w^3}{1\cdot 3}-\frac{w^5}{2\cdot 5}+\frac{w^7}{3\cdot 7}-\frac{w^9}{4\cdot 9}+\frac{w^{11}}{5\cdot 11}-\frac{w^{13}}{6\cdot 13}+\cdots.$$

Now for the evaluation, say at $$w=1/2$$, note that we have an alternating series (signs alternate, terms go down in absolute value, and have limit $$0$$).

So the error when we truncate the calculation has absolute value less than the absolute value of the first omitted term. A little playing with the calculator, or more reliably, mental arithmetic, shows we don't have to go very far to have error less than $$5\times 10^{-5}$$.

Remark: If we want an expression for the coefficients of powers of $$w$$, note that the powers are all odd, and the odd power $$w^{2k+1}$$ has, apart from sign, coefficient $$\frac{1}{k(2k+1)}$$. If we wish to take sign into account, it is positive if $$k$$ is odd and negative if $$k$$ is even. That can be captured by $$(-1)^{k+1}$$.

We can also use summation notation. However, there is a risk of losing contact with the ground. Even if we use summation notation, it is useful to write down the first few terms explicitly, as a check.

• My god. I've never realized you can easily derive the power series for $\log(1+x)$ by integrating the one for $1/(1+x)$. I always just explicitly took derivatives until I remembered the pattern. Thank you. – Potato Apr 1 '13 at 5:31
• A great many calculations of series are done by doing stuff to known series. Explicitly computing coefficients by using the Taylor formula is useful for some of the basic things, like $e^x$, $\sin x$, $\cos x$, maybe $(1+x)^r$. That's about it. – André Nicolas Apr 1 '13 at 5:38
• Jeez, as I was reading this I realized that I didn't integrate correctly at all to get my series. Thanks for the great answer. – Yak Attack Apr 1 '13 at 6:08
• @Jake: You are welcome. Unfortunately, small slips do happen, even if one is being quite careful. – André Nicolas Apr 1 '13 at 6:15

Recall that $\frac{d}{dx}\ln(1+x^2)=\frac{2x}{1+x^2}=2x\cdot\sum_{i=0}^{\infty}(-1)^ix^{2i}=2\cdot \sum_{i=0}^{\infty}(-1)^ix^{2i+1}$, so $\ln(1+x^2)=\int 2\cdot \sum_{i=0}^{\infty}(-1)^ix^{2i+1}dx=2\cdot \sum_{i=0}^{\infty}(-1)^i\frac{x^{2i+2}}{2i+2}$.