# Integral $\int_{-2}^0 \frac{x}{\sqrt{e^x+(x+2)^2}}dx$ [duplicate]

I am trying to evaluate $$\int_{-2}^0 \frac{x}{\sqrt{e^x+(x+2)^2}}dx$$ So far I had no succes using trig substitution or integration by parts, also some random substitution like $x=2t$ and moved the exponential to the numerator, but I am stuck. Could you perhaps give me an idea? (this is a college admission problem)

• It is interesting to note that the antiderivative of $\frac{x}{\sqrt{e^x+(x+2)^2}}$ is given by \begin{align}\int \frac{x}{\sqrt{e^x+(x+2)^2}}\,dx&=-2\log\left(e^{-x/2}\left((x+2)+\sqrt{e^x+(x+2)^2}\right) \right)+C\\\\&=x-2\log\left((x+2)+\sqrt{e^x+(x+2)^2}\right)+C\end{align}whereas Wolfram Alpha reports HERE that no result found in terms of standard mathematical functions. Jun 5, 2018 at 17:07
• well, humans designed the algorithm so it cant be flawless. How did you find that?
– user556151
Jun 5, 2018 at 17:09
• Just follow the approach used by @interstellarProbe. Jun 5, 2018 at 17:10
• that $2$ does anything? If we replace by $a$ can we find an anti-derivate?
– user556151
Jun 5, 2018 at 17:30
• Try it with a different number. Jun 5, 2018 at 17:37

Factor out $e^x$ in the denominator. Once you take the square root, you get $e^{x/2}$ in the denominator. Then, make the substitution:

Let $(x+2)e^{-x/2} = \tan \theta$

$-\dfrac{x}{2}e^{-x/2}dx = \sec^2 \theta d\theta$

At $x=-2$, $\tan \theta = 0$

At $x=0$, $\tan \theta = 2$

$$\int_{-2}^0 \dfrac{x}{\sqrt{e^x+(x+2)^2}}dx = -2\int_0^{\arctan 2} \sec \theta d\theta = -2\ln(\sqrt{5}+2)$$

• Clear and concise (+1). Well done. Jun 5, 2018 at 16:44
• Thank you sir. Could you please explain how did you tought of that?
– user556151
Jun 5, 2018 at 16:47
• Typically, when I see a sum of squares in the denominator, I look to get it into the form $1+u^2$ for some $u$, as I know I can make the substitution $u=\tan \theta$ and simplify the expression to $1+\tan^2 \theta = \sec^2 \theta$, getting rid of the troublesome addition in the denominator. The rest just happened to work out. Jun 5, 2018 at 16:48
• I think you lost $2e^{-x/2}$ Jun 5, 2018 at 16:50
• It is interesting to note that the antiderivative of $\frac{x}{\sqrt{e^x+(x+2)^2}}$ is given by \begin{align}\int \frac{x}{\sqrt{e^x+(x+2)^2}}\,dx&=-2\log\left(e^{-x/2}\left((x+2)+\sqrt{e^x+(x+2)^2}\right) \right)+C\\\\&=x-2\log\left((x+2)+\sqrt{e^x+(x+2)^2}\right)+C\end{align}whereas Wolfram Alpha reports HERE that no result found in terms of standard mathematical functions. Jun 5, 2018 at 17:04

Mathematica could not solve this as written, $$I=\int_{-2}^0 \frac{x}{\sqrt{e^x+(x+2)^2}}dx$$ I introduced a parameter $a$ $$I(a)=\int_{-2}^0 \frac{x}{\sqrt{a e^x+(x+2)^2}}dx$$ took a Mellin transform with respect to $a$ $$\mathcal{M}_a[I(a)](s)= \Gamma(s)\Gamma\left(\frac{1}{2}-s\right)\int_{-2}^0 \frac{x \left(\frac{e^x}{(2+x)^2}\right)^{-s}}{\sqrt{\pi}\sqrt{(x+2)^2}}dx$$ Mathematica can solve this $$\mathcal{M}_a[I(a)](s)= \frac{-4^s\Gamma(s)\Gamma\left(\frac{1}{2}-s\right)}{\sqrt{\pi}s}$$ and the inverse Mellin transform gives $$I(a) = -2 \text{arcsinh}\left(\frac{2}{\sqrt{a}}\right)$$ which for $a=1$ checks out numerically as around $I \approx -2.88727$

• Well done! (+1) Jun 5, 2018 at 16:40
• (+1) for the answer but Seeing as how this is for a college exam and OP is not familiar with integral transforms , this would be of little help to him. Jun 5, 2018 at 16:45
• Good job, on an integral calculator website, it couldn't come up with an anti-derivative but it approximated the definite integral to -2.88727095035762. Jun 5, 2018 at 16:50
• It is interesting to note that the antiderivative of $\frac{x}{\sqrt{e^x+(x+2)^2}}$ is given by \begin{align}\int \frac{x}{\sqrt{e^x+(x+2)^2}}\,dx&=-2\log\left(e^{-x/2}\left((x+2)+\sqrt{e^x+(x+2)^2}\right) \right)+C\\\\&=x-2\log\left((x+2)+\sqrt{e^x+(x+2)^2}\right)+C\end{align}whereas Wolfram Alpha reports HERE that no result found in terms of standard mathematical functions. Jun 5, 2018 at 17:07
• @Sonkun Sorry if this was a confusing approach, I will try to add a few steps in to make things clearer and perhaps more useful. There are three main integral transforms in order of decreasing importance: Fourier, Laplace and Mellin (although there are many others as well). Mellin transforms can in some situations be thought of as a bridge between a function and the coefficients of its series expansion (by the Ramanujan Master Theorem). I use them to take awkward looking parts of the integrand out at the expense of having to compute the inverse transform later. Jun 6, 2018 at 9:09