# Evaluate $\int_0^1 \frac1 {x^2+2x+3}\,\mathrm dx$

I first completed the square:

$$\int_0^1 \frac1 {2+(x+1)^2}\,\mathrm dx$$

Made the substitution $x+1=\sqrt2 \tan u$. Thus $dx=\sqrt2\sec^2udu$ substituting this in and changing the limits (please check that I have done this bit right). $$\frac{\sqrt2}{2}\int_{\tan^{-1}\frac1{\sqrt2}}^{\tan^{-1}\frac2{\sqrt2}}\,\mathrm du$$ after using the identity $\tan^2u+1=\sec^2u$ and factoring out the constants. Clearly this leads to a horrible result with many decimal places. Since this is meant to be done without a calculator, I suspect that I have done something wrong. Please help.

• What's wrong with your approach? You're not going to get a nicer answer than something like $\tan^{-1}\sqrt{2}$. Commented Dec 12, 2014 at 18:15

I don't understand what do you mean by horrible result

By proceeding with your solution or by evaluating indefinite integral and then applying limits we get

$$\int \frac1 {2+(x+1)^2}dx=\frac{1}{\sqrt{2}}\arctan\left(\frac{x+1}{\sqrt{2}}\right)$$

$$\int_0^1 \frac1 {2+(x+1)^2}dx=\frac{1}{\sqrt{2}}\left[\arctan\left(\sqrt2 \right)-\arctan\left(\frac{1}{\sqrt{2}}\right)\right]$$

You can simplify this to $$\frac{1}{\sqrt{2}}\operatorname {arccot}\left(2 \sqrt{2}\right)$$

But it will still be a horrible result

• $\arcsin\frac13/\sqrt{2}$ .. is less horrible? Commented Dec 12, 2014 at 19:08
• No, nothing wrong, thought 'simpler' looking numerator maybe. Commented Dec 12, 2014 at 19:19

we set $x+1=t$ and we get $dx=dt$ and our integral will be $\frac{1}{2}\int\frac{dt}{\left(\frac{t}{\sqrt{2}}\right)^2+1}$ and after $dt=\sqrt{2}du$ we get $$\frac{1}{2}\int \frac{\sqrt{2}du}{u^2+1}$$

Surprisingly we can take a very general approach here. Consider the function $$I=I(x;a,b,c)=\int\frac{\mathrm dx}{ax^2+bx+c}$$ With the requirement that $$4ac>b^2$$. We may compute this by comleting the square: $$I=\int\frac{\mathrm dx}{a\left(x+\frac{b}{2a}\right)^2+g}$$ Where $$g=c-\frac{b^2}{4a}$$. Then preforming the substitution $$x+\frac{b}{2a}=\sqrt{\frac{g}{a}}\tan u$$, $$I=\sqrt{\frac{g}{a}}\int\frac{\sec^2u\,\mathrm du}{g\tan^2u+g}$$ Which simplifies to $$I=\frac{2u}{\sqrt{4ac-b^2}}$$ $$I(x;a,b,c)=\frac{2}{\sqrt{4ac-b^2}}\arctan\frac{2ax+b}{\sqrt{4ac-b^2}}\,+C$$ So for your integral, we use $$a=1,b=2,c=3$$ to see that $$\int_0^1\frac{\mathrm dx}{x^2+2x+3}=I(1;1,2,3)-I(0;1,2,3)=\frac1{\sqrt2}\operatorname{arccot}2\sqrt2$$ Which is a very clean answer with infinite accuracy (as opposed to a decimal expansion)... What could be better?

Extra special Bit

If we define $$K_n=K(x;n;a,b,c)=\int\frac{\mathrm dx}{\left[a(x+b)^2+c\right]^{n+1}}$$ We can preform the substitution $$w=x+b$$ then integrate by parts with $$\mathrm dv=\mathrm dw$$ to see that $$K_n$$ satisfies the recurrence relation $$K_n=\frac{w}{2cn(aw^2+c)^n}+\frac{2n-1}{2cn}K_{n-1}$$ With base case $$K_0=I(w;a,0,c)$$. Hence we have a solution to our recurrence: $$K_n=\frac1{4^nc^n\sqrt{ac}}{2n\choose n}\arctan\left[(x+b)\sqrt{\frac{a}{c}}\right]+\frac{x+b}{2c}\sum_{k=0}^{n-1}\frac{\left[a(x+b)^2+c\right]^{k-n}}{c^k(n-k)}\prod_{i=1}^{k}\frac{2n-2i+1}{2n-2i+2}$$ And if that in all of it's infinite precision is not beautiful, then I don't know what is.