# How can I evaluate the following integral? $\int(\sqrt{x}-x)(e^{\arctan\sqrt{x}})^2dx$

How can I evaluate the following integral? $$\int(\sqrt{x}-x)(e^{\arctan\sqrt{x}})^2dx$$

I'd like the whole solution if possible. I tried using the substitution: $\sqrt{x}=t$, followed by: $2\arctan{t}=m$, to get: $$\int e^m\tan^2{\frac{m}{2}}\sec^2{\frac{m}{2}}\left[1-\tan{\frac{m}{2}}\right]dm$$ But it doesn't get me anywhere.

A complete solution will be sincerely appreciated.

• Maybe it helps to know that the result is $-\frac{1}{2}(\sqrt{x}-1)^2 (x+1) e^{2 \arctan\sqrt{x}}+C$ . Feb 16, 2017 at 11:33
• I'd like to use a method without involving complex variables. Additionally, I know the result - my brain seems to have shut down unfortunately, despite the problem being so simple. :( Feb 16, 2017 at 11:34
• "despite the problem being so simple" ???
– user65203
Feb 16, 2017 at 11:35
• Yea. In a worksheet of many integrals, this happens to be one of the easier ones as classified by section headings. Feb 16, 2017 at 12:19
• @Kugelblitz. Could you tell where they say that the problem is simple ? I am just curious. Cheers. Feb 16, 2017 at 14:03

Assume the integral can be written in the form $g(x) = f(x) e^{2\arctan \sqrt{x}}$ for some unknown function $f(x).$ Then $$g'(x) = \left(f' + \frac{f}{\sqrt{x}(1+x)}\right)e^{2\arctan \sqrt{x}}$$ must be the integrand, meaning $$f' + \frac{f}{\sqrt{x}(1+x)} = \sqrt{x}-x$$ or $$\sqrt{x}(1+x)f' + f = x - x^{3/2} + x^2 - x^{5/2}.$$

Now find a particular solution of this ODE for $f$ via the method of undetermined coefficients with $f(x)=a_0 + a_1\sqrt{x} + a_2 x + a_3 x^{3/2} + a_4x^2.$ This results in six linear equations in the five unknown $a_i.$ The six equations are consistent though, with $a_4=-1/2,$ $a_3=1,$ $a_2=-1,$ $a_1=1,$ and $a_0=-1/2.$

• Mathematica gives: $-\frac{1}{2} \left(\sqrt{x}-1\right)^2 (x+1) e^{2 \tan ^{-1}\left(\sqrt{x}\right)}$ Feb 19, 2017 at 23:19
• @DavidG.Stork: I know (this is stated in the comments for the question and I also checked Wolfram Alpha). My answer is just the expansion of this product Feb 19, 2017 at 23:38
• I see. There must, however, be a more elegant method using integration techniques. Nevertheless, thank you. Feb 20, 2017 at 2:56
• Possibly there is some other way, but my answer is pretty easy. The system of equations for the $a_i$ is upper triangular with a lot of zeros in the upper triangle, so it's easy to solve by hand. Feb 20, 2017 at 5:44

To solve such a problem without literature and programs I would set

$\displaystyle \int (\sqrt{x}-x)e^{2\arctan\sqrt{x}}dx = 2\int (t^2-t^3)e^{2\arctan t}dt := 2p(t)e^{2\arctan t} + C$

with $\enspace x=t^2$ and knowing that $\enspace \displaystyle (\arctan t)’=\frac{1}{1+t^2}$ . $\enspace p(t)$ is a polynom.

Such methods I’ve learned in the school (means: it's nothing special).

The derivation of both sides by $\enspace t\enspace$ and multiplicating by $\enspace 1+t^2\enspace$ gives

$\displaystyle (t^2-t^3)(1+t^2)=(1+t^2)p’(t)+p(t)\enspace$ and we know now that the degree of the left side is $\enspace 5$

and it follows for $\enspace p(t)\enspace$ the degree $\enspace 4$ : $\enspace p(t):=a+bt+ct^2+dt^3+et^4$ .

Comparing the coefficients we get $\enspace \displaystyle (a;b;c;d;e)=(-\frac{1}{4};\frac{1}{2};-\frac{1}{2};\frac{1}{2};-\frac{1}{4})$

and therefore $\enspace \displaystyle p(t)=-\frac{1}{4}(1-2t+2t^2-2t^3+t^4)\enspace$ with $\enspace t=\sqrt{x}$.

• Where is the $2t dt$ term? I only see the $2$ without the $t$. What is your guess for $p(t)\exp(..)$ based on? What is the name of that integration technique ? I have never got that taught in my school. Feb 22, 2017 at 17:05
• @Shashi : Thanks for the hint with $t$, it was only a writing mistake. For integration you learn a lot of different methods. I don't know all the names but here we have a reduction to the inhomogeneous linear differential equation of the first order. $\int a(x)e^{f(x)}dx=b(x)e^{f(x)}+C$ can be solved by $b'(x)+f'(x)b(x)=a(x)$ . Feb 22, 2017 at 21:24
• yea now I get it. It is very smart! (+1) Thanks for the explanation! Feb 22, 2017 at 21:36
• @Shashi : You are welcome! :-) Feb 23, 2017 at 6:08