16

I would like to study how to evaluate the definite integral$$\int_{-\infty}^\infty \frac{x-2}{(x^2+x+4)\sqrt{x^2+2x+4}}dx $$

Based on the integration techniques that I know, I proceed by completing the square and then introducing the trigonometric substitution $x+1=\sqrt3 \sinh t$ to transform the integral to $$ \int_{-\infty}^\infty \frac{\sqrt3 \sinh t-3 }{3\sinh^2t-\sqrt3\sinh t +4}dt $$ At this point, I further introduce the ‘half-angle’ substitution $y=\tanh\frac t2$. But, the resulting integrand is of a quartic function in $y$, which I do not how how to deal with. I prefer using real method.

Integreek
  • 8,530
Ace
  • 2,159

7 Answers7

9

Continue with the trig-substitution \begin{align} & \int_{-\infty}^\infty \frac{\sqrt3 \sinh t-3 }{3\sinh^2t-\sqrt3\sinh t +4}\ dt\\ =& \int_{-\infty}^\infty \frac{(\sqrt3\sinh t-3) \,\text{sech}^2t }{(3\cosh^2t-\sqrt3\sinh t +1)\, \text{sech}^2t}\ dt \\ =& \int_{-\infty}^\infty \frac{\sqrt3 \tanh t \,\text{sech}\,t-3\,\text{sech}^2t}{3 -\sqrt3 \,\text{sech}\,t \tanh t+ \text{sech}^2t}\ dt \\ =& \ {2\sqrt3}\int_{-\infty}^\infty \frac{d(\text{sech}\,t+\sqrt3\tanh t )}{(\text{sech}\,t+\sqrt3\tanh t)^2-9}\\ =& \ \frac2{\sqrt3}\ln(2-\sqrt{3}) \end{align}

Quanto
  • 120,125
  • I know right. I'm telling the truth. Owing to the fact that I'm still in highschool, I know nothing of hyperbolic trigo functions. Before answering this question, I looked up hyperbolic trigo functions and learnt them, so I know nothing of their identities. OP mentioned half angle sub, hence I learnt it, and after that everything I did didn't have trigonometry at all. Great answer...poor me. +1 – Gwen May 04 '24 at 19:35
  • Not really trigs but hyperbolic – Vincenzo Tibullo May 05 '24 at 15:08
  • 3
    @Gwen Don’t be deterred by the fact high school didn't teach you it. Hyperbolic functions are just as easy to learn as regular trig functions. In fact, most exotic special functions are. You just got to start with a the definitions and work through the properties. Never be afraid to do this yourself! – David H May 17 '24 at 02:21
  • @DavidH thanks for this. I already learnt it that day itself. Still pretty shaky with the identities though :) – Gwen May 17 '24 at 07:28
7

$$\begin{align}\int_{-\infty}^\infty\frac{x-2}{(x^2+x+4)\sqrt{x^2+2x+4}}\mathrm dx&\overset{t=\frac{2-x}{2+x}}{=}8\int_{-\infty}^1\frac{t\,\mathrm dt}{(3t^2+5)\sqrt{t^2+3}}\\&\overset{u=\sqrt{t^2+3}}{=}8\int_2^\infty\frac{\mathrm du}{4-3u^2}\\&=\frac{-4}{\sqrt3}\coth^{-1}\sqrt3+C\end{align}$$

Credit:

I got the idea of the substitution $t=\dfrac{2-x}{2+x}$ from @ClaudeLeibovici's answer.

Integreek
  • 8,530
5

Let $\mathcal{I}$ denote the value of the following (convergent) improper integral:

$$\mathcal{I}:=\int_{-\infty}^{\infty}\mathrm{d}x\,\frac{x-2}{\left(x^{2}+x+4\right)\sqrt{x^{2}+2x+4}}\approx-1.52069.$$


Using the Euler substitution

$$\sqrt{x^{2}+2x+4}=x+y\implies x=\frac{4-y^{2}}{2(y-1)},$$

we can rewrite $\mathcal{I}$ as an integral of a rational function:

$$\begin{align} \mathcal{I} &=\int_{-\infty}^{\infty}\mathrm{d}x\,\frac{x-2}{\left(x^{2}+x+4\right)\sqrt{x^{2}+2x+4}}\\ &=\int_{+\infty}^{1}\mathrm{d}y\,\frac{(y^{2}+4y-8)}{2(y-1)^{2}}\cdot\frac{1}{\left[\frac{4-y^{2}}{2(y-1)}\right]^{2}+\left[\frac{4-y^{2}}{2(y-1)}\right]+4};~~~\small{\left[x=\frac{4-y^{2}}{2(y-1)}\right]}\\ &=-\int_{1}^{\infty}\mathrm{d}y\,\frac{2y^{2}+8y-16}{y^{4}-2y^{3}+10y^{2}-24y+24}.\\ \end{align}$$


We'd like to find a way to express the quartic in the denominator of the integrand as a difference of squares of the form

$$y^{4}-2y^{3}+10y^{2}-24y+24=\left(y^{2}+ay+b\right)^{2}-\left(cy+d\right)^{2},$$

for suitable values of $(a,b,c,d)\in\mathbb{R}^{4}$. Expanding the RHS and matching coefficients, it can be shown that

$$y^{4}-2y^{3}+10y^{2}-24y+24=\left(y^{2}-y+6\right)^{2}-3\left(y+2\right)^{2}.$$

We can then use partial fractions and integrate to obtain

$$\begin{align} \mathcal{I} &=-\int_{1}^{\infty}\mathrm{d}y\,\frac{2y^{2}+8y-16}{y^{4}-2y^{3}+10y^{2}-24y+24}\\ &=-\int_{1}^{\infty}\mathrm{d}y\,\frac{2y^{2}+8y-16}{\left(y^{2}-y+6\right)^{2}-3\left(y+2\right)^{2}}\\ &=-\int_{1}^{\infty}\mathrm{d}y\,\frac{2y^{2}+8y-16}{\left[\left(y^{2}-y+6\right)-\sqrt{3}\left(y+2\right)\right]\left[\left(y^{2}-y+6\right)+\sqrt{3}\left(y+2\right)\right]}\\ &=-\int_{1}^{\infty}\mathrm{d}y\,\frac{2y^{2}+8y-16}{\left[y^{2}-\left(1+\sqrt{3}\right)y+6-2\sqrt{3}\right]\left[y^{2}-\left(1-\sqrt{3}\right)y+6+2\sqrt{3}\right]}\\ &=-\int_{1}^{\infty}\mathrm{d}y\,\frac{1}{\sqrt{3}}\left[\frac{2y-\left(1+\sqrt{3}\right)}{y^{2}-\left(1+\sqrt{3}\right)y+6-2\sqrt{3}}-\frac{2y-\left(1-\sqrt{3}\right)}{y^{2}-\left(1-\sqrt{3}\right)y+6+2\sqrt{3}}\right]\\ &=-\frac{1}{\sqrt{3}}\int_{1}^{\infty}\mathrm{d}y\,\frac{d}{dy}\left[\ln{\left(y^{2}-\left(1+\sqrt{3}\right)y+6-2\sqrt{3}\right)}-\ln{\left(y^{2}-\left(1-\sqrt{3}\right)y+6+2\sqrt{3}\right)}\right]\\ &=\frac{1}{\sqrt{3}}\left[\ln{\left(1-\left(1+\sqrt{3}\right)+6-2\sqrt{3}\right)}-\ln{\left(1-\left(1-\sqrt{3}\right)+6+2\sqrt{3}\right)}\right]\\ &=-\frac{1}{\sqrt{3}}\left[\ln{\left(2+\sqrt{3}\right)}-\ln{\left(2-\sqrt{3}\right)}\right]\\ &=-\frac{2}{\sqrt{3}}\ln{\left(2+\sqrt{3}\right)}.\blacksquare\\ \end{align}$$


David H
  • 32,536
  • 1
    A nice approach! https://en.wikipedia.org/wiki/Euler_substitution is a powerful tool but was easily neglected. – MathArt May 05 '24 at 15:07
  • @MathArt I almost missed it too! The case for two general quadratics leads to a much more difficult resolvent sextic to solve. In this case it was easily factorable. – David H May 17 '24 at 02:48
4

I've sat looking at this for hours, until I found this out. During half angle substituting, I'm sure you will get $$ \int_{-∞}^{∞} \frac{\frac{2\sqrt 3 \tanh (\frac{t}{2})}{1-\tanh^2(\frac{t}{2})} -3}{-\frac{2\sqrt 3 \tanh (\frac{t}{2})}{1-\tanh^2(\frac{t}{2})}+12\big(\frac{ \tanh (\frac{t}{2})}{1-\tanh^2(\frac{t}{2})}\big)^2+4}dt$$ Or $$\int_{-∞}^{∞} \frac{2\sqrt 3 \tanh (\frac{t}{2})(1-\tanh^2(\frac{t}{2}))-3(1-\tanh^2(\frac{t}{2}))^2}{(-2\sqrt 3 \tanh (\frac{t}{2}))(1-\tanh^2(\frac{t}{2}))+12\big({ \tanh (\frac{t}{2})}\big)^2+4(1-\tanh^2(\frac{t}{2}))^2}dt$$

Taking $k=\tanh\frac{t}{2} \implies dk=\frac{\text{sech} ^2\frac{t}{2}}{2} dt =\frac{1-k^2}{2} dt$

Thus $\int_{-1}^{1} \frac{2\sqrt 3k(1-k^2)-3(1-k^2)^2}{-2\sqrt 3k(1-k^2)+12k^2+4(1-k^2)^2}×\frac{2}{1-k^2} dk$

Or $$\int_{-1}^{1} \frac{2\sqrt 3k -3(1-k^2)}{\sqrt 3k(k^2-1)+6k^2+2(1-k^2)^2} dk$$ Or $$\int_{-1}^{1} \frac{3k^2-2\sqrt 3 k -3}{2k^4+\sqrt 3 k^3 + 2k^2-\sqrt 3k+2} dk$$ We first simplify the denominator. This is the part that took so much time. We can write it as $$2k^4+(2\sqrt 3 k^3 -\sqrt 3 k^3) + (4k^2 -3k^2)+ k^2 +(\sqrt 3 k - 2\sqrt 3 k) +2$$ Or $$2k^2(k^2+\sqrt 3 k +2)+(k^2+\sqrt 3k +2)-\sqrt 3 k^3 -3k^2-2\sqrt 3k$$

Even I don't know how I found this. But this is factorisable!!!

This is $$=(2k^2+1-\sqrt 3k)(k^2+\sqrt 3k+2)$$

Thus our integral becomes $$\int \frac{3k^2-2\sqrt 3k-3}{(2k^2+1-\sqrt 3k)(k^2+\sqrt 3k+2)} dk$$

We shall follow partial fraction method, $\int\frac{(Ak+B)(k^2+\sqrt 3k+2)-(Ck+D)(2k^2+1-\sqrt 3k)}{(2k^2+1-\sqrt 3k)(k^2+\sqrt 3k+2)} dk$

By solving simultaneous equations, we get $$A=\frac{4\sqrt 3}{3},B=-1,C=\frac{2\sqrt 3}{3},D=1$$

Thus, our integral becomes $$\frac{1}{3}\int_{-1}^{1} \frac{4\sqrt 3k -3}{2k^2-\sqrt 3k+1} dk - \frac{1}{3}\int_{-1}^{1} \frac{2\sqrt 3 k +3}{k^2+\sqrt 3 k+2}dk$$ $$=\frac{\sqrt 3}{3}\int_{-1}^{1} \frac{4k-\sqrt 3}{2k^2-\sqrt 3k+1} dk - \frac{\sqrt 3}{3}\int_{-1}^{1} \frac{2k+\sqrt 3 }{k^2+\sqrt 3 k+2}dk$$ $$=\frac{1}{\sqrt 3} \bigg[\ln(|2k^2-\sqrt 3k+1|)\bigg|_{-1}^{1}-\ln(|k^2+\sqrt 3k+2|)\bigg|_{-1}^{1}\bigg]$$ $$=\frac{1}{\sqrt 3}×2\ln\bigg|\frac{3-\sqrt 3}{3+\sqrt 3}\bigg|$$ $$=\ln\bigg(\bigg|\frac{3-\sqrt 3}{3+\sqrt 3}\bigg|^{\frac{2}{\sqrt 3}}\bigg)\\≈-1.520691992601$$

Gwen
  • 3,910
  • 6
  • 19
3

A long way for an interesting integral.

$$I=\int \frac{x-2}{(x^2+x+4)\sqrt{x^2+2x+4}}\,dx$$

If you start, as @MathArt did, with

$$u=\frac {2-x}{2+x}\quad \implies \quad I=\int\frac{4 u}{ \left(3 u^2+5\right)\sqrt{u^2+3}}\,du$$

$$\frac{4 u}{\left(3 u^2+5\right)}=\frac{2}{3 u+i \sqrt{15}}+\frac{2}{3 u-i \sqrt{15}}$$

So, two antiderivatives to be computed lookonk like $$J=\int \frac{du}{ (3 u+a)\sqrt{u^2+3}}$$

$$u=\sqrt{3} \tan (v)\quad \implies \quad J=\int \frac{dv}{a \cos (v)+3 \sqrt{3} \sin (v)}$$ Using the tangent half-angle substitution $$v=2 \tan ^{-1}(w)\quad \implies \quad J=\int \frac{2}{-a w^2+6 \sqrt{3} w+a}\,dw$$ which is simple $$J=-\frac{2 }{\sqrt{-a^2-27}}\tan ^{-1}\left(\frac{a w-3 \sqrt{3}}{\sqrt{-a^2-27}}\right)$$ So, $$I=-\frac{1}{\sqrt{3}} \left(\tanh ^{-1}\left(\frac{3}{2}-\frac{ i \sqrt{5}}{2} w\right)+\tanh^{-1}\left(\frac{3}{2}+\frac{ i \sqrt{5}}{2} w\right)\right)$$ Back to $x$ and trying to simplify a little bit $$I=\frac{2}{\sqrt{3}}\tanh ^{-1}\left(\frac{-2 x^2+\left(2 \sqrt{x^2+2 x+4}-3\right) x+\sqrt{x^2+2 x+4}-10}{\sqrt{3} \left(\sqrt{x^2+2 x+4}-x+2\right)}\right)$$

Then the result for the definite integral $$\large\color{blue}{\frac{1}{\sqrt{3}}\log \left(7-4 \sqrt{3}\right)}$$

Edit

I we were looking at

$$I=\int_{-p}^{+p} \frac{x-2}{(x^2+x+4)\sqrt{x^2+2x+4}}\,dx$$ using the above and expanding as a series for large values of $p$ $$I=\frac{1}{\sqrt{3}}\log \left(7-4 \sqrt{3}\right)+\frac{4}{p^2}-\frac{19}{2 p^4}+\frac{11}{p^6}+O\left(\frac{1}{p^8}\right)$$

1

$$\mathcal I=\int_{-\infty}^\infty\frac{x-2}{(x^2+x+4)\sqrt{x^2+2x+4}}\mathrm dx=\underbrace{\int_{-\infty}^0\frac{x-2}{(x^2+x+4)\sqrt{x^2+2x+4}}\mathrm dx}_{\mathcal I_1}+\underbrace{\int_0^\infty\frac{x-2}{(x^2+x+4)\sqrt{x^2+2x+4}}\mathrm dx}_{\mathcal I_2}$$

Now,

$$\mathcal I_1\overset{x\to-x}{=}-\int_0^\infty\frac{x+2}{(x^2-x+4)\sqrt{x^2-2x+4}}\mathrm dx$$ $$\mathcal I_2\overset{x\to\frac4x}{=}-\mathcal I_2\implies \mathcal I_2=0$$

Now, using the technique mentioned in this post to evaluate integrals of the type $\displaystyle\int\frac{L}{Q_1\sqrt{Q_2}}\mathrm dx$,

$$\begin{align}\mathcal I&= -\int_0^\infty\frac{x+2}{(x^2-x+4)\sqrt{x^2-2x+4}}\mathrm dx\\&=-2\int_0^\infty\frac{\frac1{2\sqrt x}+\frac1{x\sqrt x}}{\left(x+\frac4x-1\right)\sqrt{x+\frac4x-2}}\mathrm dx\\&\overset{t=\sqrt x-\frac2{\sqrt x}}{=}-4\int_0^\infty\frac{\mathrm dt}{(t^2+3)\sqrt{t^2+2}}\\&\overset{u=\frac1t}{=}-\frac{2\sqrt2}3\int_0^\infty\frac{u\,\mathrm du}{\left(u^2+\frac13\right)\sqrt{u^2+\frac12}}\\&\overset{v=\sqrt{u^2+\frac12}}{=}\frac{2\sqrt2}3\int_\frac1{\sqrt2}^\infty\frac{\mathrm dv}{\frac16-v^2}\\&=-\frac4{\sqrt3}\coth^{-1}\sqrt3\\&=\frac2{\sqrt3}\ln\left(2-\sqrt3\right)\end{align}$$

Integreek
  • 8,530
1

The denominator of the integrand is of the form $$(Ax^2+2Bx+C)\sqrt{ax^2+2bx+c}$$ where both the quadratic polynomials have complex roots. In such a case one uses the substitution $x=(pt+q)/(t+1)$ where $p, q$ are roots of $$(aB-bA) z^2-(cA-aC) z+(bC-cB) =0$$ (one can prove that the above equation must have real roots). For current problem $$a=A=1,b=1,B=1/2,c=C=4$$ so that $p, q$ are roots of $-z^2/2+2=0$ ie $p=2,q=-2$ and thus we can put $x=2(t-1)/(t+1)$ to get $$x^2+x+4=\frac{10t^2+6} {(t+1)^2}$$ and $$\sqrt{x^2+2x+4} =\frac{\sqrt{12t^2+4} }{\text {sgn}(t+1)\cdot (t+1)}$$ and $$x-2=-\frac{4}{t+1}$$ and $$dx=\frac{4dt}{(t+1)^2}$$ Note further that the substitution is discontinuous at $x=2$ so we need to split the range of integration as $(-\infty, 2),(2,\infty)$ and these map to $(-1,\infty),(-\infty,-1)$ as far as variable $t $ is concerned.

The desired integral is thus $$4\int_{-\infty} ^{-1}\frac{dt}{(5t^2+3)\sqrt{3t^2+1}}-4\int_{-1}^{\infty}\frac{dt}{(5t^2+3)\sqrt{3t^2+1}} $$ We can change the range of first integral to $(1,\infty)$ by replacing $t$ with $-t$ and then the above difference of two integrals equals $$-4\int_{-1}^1\frac{dt}{(5t^2+3)\sqrt{3t^2+1}}=-8\int_0^1\frac{dt}{(5t^2+3)\sqrt{3t^2+1}}$$ Next we put $u=t/\sqrt{3t^2+1}$ and the integral then equals $$-8\int_0^{1/2}\frac{du}{3-4u^2}=-2\int_0^{1/2}\frac{du}{(3/4)-u^2}$$ which easily evaluates to $$-\frac{2}{\sqrt{3}}\log (2+\sqrt{3})$$