2

Answers obtained from two online integral calculators:

$$\begin{align}\int\dfrac{\sqrt{1 + x}}{\sqrt{1 - x}}\,\mathrm dx &= -\sqrt{\dfrac{x + 1}{1 - x}} + \sqrt{\dfrac{x + 1}{1 - x}}x - 2\arcsin\left(\dfrac1{\sqrt2}\sqrt{1 - x}\right) + C \\ \int\dfrac{\sqrt{1 + x}}{\sqrt{1 - x}}\,\mathrm dx &= 2\sin^{-1}\left(\dfrac{\sqrt{x + 1}}{\sqrt2}\right) - \sqrt{1 - x^2} + \text{ constant} \end{align}$$

Answers from online calculator shown above, and my answers shown in the link:

Indefinite integral question with my two answers


Update:

I realized that the substitution for $\theta$ was supposed to be $\arcsin$ not $\arccos$, so the answer would have been the same as the right hand side.

But I also noticed that using the initial substitution to plug $x$ back in the final answer will not always give the correct answer because in a similar question:

$$\int \frac{\sqrt{x^2-1}}x dx$$

has a trig-substitution of $x = \sec\theta$, and the answer in terms of $\theta$ would be: $\tan \theta - \theta + C$. Then the final answer in terms of $x$ should be : $\sqrt{x^2-1} - \operatorname{arcsec}(x) + C$.

But online integral calculators give the answer: $\sqrt{x^2-1} - \arctan(\sqrt{x^2-1}) + C$, which doesn't match the original substitution of:

$$x = \sec\theta \to \theta = \operatorname{arcsec}(x)$$

Anyone know why the calculator gives that answer which doesn't match the original trig-substitution of $x = \sec \theta \to \theta = \operatorname{arcsec}(x)$?

an4s
  • 3,803
  • You assumed $x=sin\theta$, so $\theta = arcsin x$ –  Feb 17 '20 at 20:26
  • 2
    Oh so the theta value must also match with the substitution I made for x? –  Feb 17 '20 at 20:32
  • In short yes, assuming $x>0$, note that $arcsinx = arccos√(1-x^2)$ for only $x>0$ –  Feb 17 '20 at 20:38
  • which is the actual answer though? When I plug the question into different online integral calculators, all answers are very different from mine –  Feb 17 '20 at 20:44
  • The picture above are the two answers I got from two online integral calculators –  Feb 17 '20 at 20:51
  • Hey, I MathJax'd up your question for you, it should be in the edit queue I guess :) – indnwkybrd Feb 17 '20 at 20:51
  • It says I need at least 2k rep –  Feb 17 '20 at 20:54
  • On your answer on the left, you chose $x = \sin(\theta)$, not $x = \cos(\theta)$, so why did you substitute $\theta = \arccos\left(\sqrt{1-x^2}\right)$ (which was pointed out in a previous comment)? Otherwise, your two answers would have turned out the same, and they're correct. Note that "different answers" are only just answers that differ from yours by a constant. – KM101 Feb 17 '20 at 21:12
  • Yeah that is what I thought of doing when using trig substitution. But when computing a similar question that also involves trig-sub: √(x^2-1)/x, the answer the calculator gives for the theta value in the indefinite integral is arctan(√(x^2-1)/x) instead of (arcsec or arccos), to which the original substitution was x = secθ. –  Feb 17 '20 at 21:19
  • For example in a similar question: the indefinite integral of √(x^2-1)/x, can have a trig-sub of x = secθ, then the answer in terms of theta will be: tanθ - θ + C. Then then final answer should be : √(x^2-1) - arcsec(x) + C, but the calculator gives √(x^2-1) - arctan(√(x^2-1)) + C, which doesn't match the original substitution of
    x = secθ
    –  Feb 17 '20 at 21:25
  • Anyone know why the calculator gives that answer which doesn't match the original trig-substitution of x = secθ --> θ = arcsec(x)? –  Feb 17 '20 at 23:16
  • 2

3 Answers3

3

Now, both answers are correct. They merely look different. They differ by a constant.

Note 1...

$$ -\sqrt{\frac{x+1}{1-x}}+\sqrt{\frac{x+1}{1-x}}\;x = -\sqrt{\frac{x+1}{1-x}}\;(1-x) = -\frac{\sqrt{x+1}\;(1-x)}{\sqrt{1-x}} \\= -\sqrt{x+1}\sqrt{1-x} =-\sqrt{(1+x)(1-x)} =-\sqrt{1-x^2} $$

Note 2... $$ 2\,\arcsin \left( \frac{\sqrt {1+x}}{\sqrt {2}} \right) =\pi-2\,\arcsin \left( \frac{\sqrt {1-x}}{\sqrt {2}} \right) $$

GEdgar
  • 117,296
  • For the second line of step, I multiplied top and bottom by √(1+x) in order to use the trig substitution of x = sinθ –  Feb 17 '20 at 21:12
  • Also those two answers are from the calculator. I was wondering if they are correct after comparing them to my answers, which are shown in the link –  Feb 17 '20 at 21:27
2

Since you've already understood the first part, I'll address your second question.

Starting off with $\displaystyle\int \frac{\sqrt{x^2-1}}{x}\mathrm dx$, substitute $x = \sec(\theta)$ for $\theta \in \left[0, \frac{\pi}{2}\right) \cup \left(\frac{\pi}{2}, \pi\right]$ as usual (keep the domain in mind for later). Of course, that means $\sqrt{x^2-1} = \sqrt{\sec^2(\theta)-1} = \sqrt{\tan^2(\theta)} = \vert \tan(\theta)\vert$ and $\dfrac{\mathrm dx}{\mathrm d\theta} = \sec(\theta)\tan(\theta) \iff \mathrm dx = \sec(\theta)\tan(\theta)\mathrm d\theta$. This simplifies as follows:

$$\displaystyle\int \frac{\sqrt{x^2-1}}{x}\mathrm dx \longrightarrow \int\frac{\vert \tan(\theta)\vert}{\sec(\theta)}\sec(\theta)\tan(\theta)\mathrm d\theta = \int\vert \tan(\theta)\vert\tan(\theta)\mathrm d\theta$$

For $\theta \in \left[0, \frac{\pi}{2}\right)$, $\tan(\theta) \geq 0$, so you get

$$\int \tan^2(\theta) \mathrm d\theta = \int \left[\sec^2(\theta)-1\right] \mathrm d\theta = \tan(\theta)-\theta+C \longrightarrow \sqrt{x^2-1}-\text{arcsec}(x)+C$$

Since tangent is positive in the first quadrant, $\tan(\theta) = \sqrt{x^2-1}$, so the $\theta$ term can also be replaced with $\arctan\left(\sqrt{x^2-1}\right)$.

For $\theta \in \left(\frac{\pi}{2}, \pi\right]$, $\tan(\theta) \leq 0$, so you get

$$-\int \tan^2(\theta) \mathrm d\theta = -\int \left[\sec^2(\theta)-1\right] \mathrm d\theta = \theta-\tan(\theta)+C \longrightarrow \sqrt{x^2-1}+\text{arcsec}(x)+C$$

Since tangent is negative in the second quadrant, $\tan(\theta) = \tan(\theta -\pi) = -\sqrt{x^2-1}$ (remember that tangent takes arguments in the first and fourth quadrants), so the $\theta$ term can also be replaced with $\pi-\arctan\left(\sqrt{x^2-1}\right)$.

In both cases, the anti-derivative could be re-written as $\sqrt{x^2-1}-\arctan\left(\sqrt{x^2-1}\right)+C$. Basically, it just "combines" your other two anti-derivatives and expresses them as a single function rather than having one for each case.

KM101
  • 7,194
  • Would just leaving the answer as: √(x^2-1) - arcsec(x) + C , still be correct? –  Feb 18 '20 at 00:09
  • For indefinite integrals, we usually assume $\tan(\theta)$ is positive (at least from what I've seen), so yeah, that's fine. – KM101 Feb 18 '20 at 00:16
1

Let \begin{align} I &= \int \frac{\sqrt{1+x}}{\sqrt{1-x}}\;dx = \int \frac{1+x}{\sqrt{1-x^2}}\;dx \end{align} Left side:

Let $x = \sin\theta$, $dx = \cos\theta\;d\theta$. \begin{align} I &= \int \frac{1+\sin\theta}{\sqrt{\cos^2\theta}}\cos\theta\;d\theta \\ &= \int \left(1+\sin\theta \right)d\theta \\ &= \theta - \cos\theta + c \\ &= \arccos\left(\sqrt{1-x^2}\right) - \sqrt{1-x^2} + c \end{align}

Right side:

\begin{align} I &= \int \frac{1}{\sqrt{1-x^2}}\;dx + \int \frac{x}{\sqrt{1-x^2}}\;dx \\ u &= 1 - x^2,\;\; -\frac{1}{2}du = x\,dx \\ \implies I &= \arcsin x - \frac{1}{2}\int u^{-1/2}\;du \\ &= \arcsin x - \sqrt{u} + c \\ &= \arcsin x - \sqrt{1 - x^2} + c \end{align}

The answers would be the exact same, if $\arccos\left(\sqrt{1-x^2}\right) = \arcsin x$. And therein lies the difference. On the "Left side", the substitution you originally made was $x = \sin\theta$. So when you replace $\theta$ you should substitute $\theta = \arcsin x$.

By the rules of trig substitution, they should be equivalent. But canonically, the arcsin function has a range of $-\pi/2$ to $\pi/2$, while the arccos function has a range of $0$ to $\pi$. So when you use $\arccos\left(\sqrt{1-x^2}\right)$, as-is you are losing the case where $-1 < x < 0$. The integral has a kink in it, but that's not what you want, seeing as how the function being integrated is continuous and differentiable at $x=0$.

You could shift arccos by an appropriate amount and use that solution, but I think it would be easier to go with arcsin here.

indnwkybrd
  • 1,043
  • 1
    Yes the wrong substitution of θ, seemed to cause the problem. But aside from substituting x back in the answer, do you know if the x's you sub back in is always supposed to correspond to the original substitution made? For example, see my updated question at the top to see what I mean –  Feb 17 '20 at 21:41