# is there a primary antiderivative for this function?

I came across this integral in my maths textbook.

$$\int\dfrac{\left(x^2-2\right)\mathrm{e}^x}{\left(x-1\right)\sqrt{1-x^2}}$$

after close to 30 minutes of trying u-sub, trig sub, integration by parts I gave up and plugged it into wolfram-alpha and the following integral calculator - https://www.integral-calculator.com/. Wolfram alpha couldn't compute an elementary antiderivative. I am confused however by the response on the latter.

It couldn't compute a " manual antiderivative" and displayed: " No antiderivative could be found within the given time limit, or all supported integration methods were tried unsuccessfully. Note that many functions don't have an elementary antiderivative. "

However under " ANTIDERIVATIVE COMPUTED BY MAXIMA " it displayed the following function.

$$-\dfrac{\sqrt{1-x}\sqrt{x+1}\mathrm{e}^x}{x-1}$$

I differentiated this and confirmed it is infact the anti derivative but what method should I employ to obtain the computed antiderivative? And why did wolfram alpha display there's no elementary anti derivative whereas the other website could compute one?

• Maple can solve,but Mathematica can't. Dec 4, 2023 at 10:04

We have $$$$(1) \int \frac{(x^{2}-2)e^{x}}{(x-1)\sqrt{1-x^{2}}}dx = \int \frac{(x^{2}-1)e^{x}}{(x-1)\sqrt{1-x^{2}}}dx - \int \frac{e^{x}}{(x-1)\sqrt{1-x^{2}}}dx.$$$$

Since $$\frac{d}{dx}\left(\frac{(x^{2}-1)}{(x-1)\sqrt{1-x^{2}}}\right) = -\frac{1}{(x-1)\sqrt{1-x^{2}}},$$ if we integrate by parts $$\int \frac{(x^{2}-1)e^{x}}{(x-1)\sqrt{1-x^{2}}}dx$$, we obtain

$$\int \frac{(x^{2}-1)e^{x}}{(x-1)\sqrt{1-x^{2}}}dx = \frac{(x^{2}-1)e^{x}}{(x-1)\sqrt{1-x^{2}}} + \int \frac{e^{x}}{(x-1)\sqrt{1-x^{2}}}dx.$$

Replace it in $$(1)$$ and we obtain $$$$\label{a} \int \frac{(x^{2}-2)e^{x}}{(x-1)\sqrt{1-x^{2}}}dx = \frac{(x^{2}-1)e^{x}}{(x-1)\sqrt{1-x^{2}}} + \int \frac{e^{x}}{(x-1)\sqrt{1-x^{2}}}dx - \int \frac{e^{x}}{(x-1)\sqrt{1-x^{2}}}dx.$$$$

Thus, $$\int \frac{(x^{2}-2)e^{x}}{(x-1)\sqrt{1-x^{2}}}dx = \frac{(x^{2}-1)e^{x}}{(x-1)\sqrt{1-x^{2}}} = -\frac{\sqrt{1-x}\sqrt{x+1}\, e^{x}}{x-1}.$$

• Nice and simple solution .....(after reading it). Cheers and (+1) Dec 4, 2023 at 13:37

Credits to ZAF

In general, for any function $$f(x)$$, $$\int f(x)e^xdx=g(x)e^x+C \Rightarrow f(x)e^x=(g(x)e^x)’=(g(x)+g’(x))e^x$$ Hence we have $$\boxed{f(x)=g(x)+g’(x)}$$ All we have to do to find the function $$g(x)$$ is splitting $$f(x)$$ into two functions $$g(x)$$ and its derivative $$g’(x).$$ Noticing that $$\frac{d}{d x}\left(\frac{x^2-1}{(x-1) \sqrt{1-x^2}}\right)=-\frac{1}{(x-1) \sqrt{1-x^2}},$$ we have \begin{aligned} f(x) & =\frac{x^2-2}{(x-1) \sqrt{1-x^2}}=\frac{x^2-1}{(x-1) \sqrt{1-x^2}}-\frac{1}{(x-1) \sqrt{1-x^2}} \\ & =\frac{x^2-1}{(x-1) \sqrt{1-x^2}}+\left(\frac{x^2-1}{(x-1) \sqrt{1-x^2}}\right)^{\prime} \end{aligned} We can now conclude that $$\int \frac{(x^2-2) e^x}{(x-1)\sqrt{1-x^2}} d x=\frac{x^2-1}{(x-1) \sqrt{1-x^2}} e^x= \sqrt{\frac{1+x}{1-x}} e^x+C$$