5

This is example $2$ in my "Integration Using Some Euler-Like Identities" blog post.

$$\int\frac{1}{\tan\left(\frac{1}{2}\csc^{-1} (x)\right) - \tan\left(\frac{1}{2}\sec^{-1}(x)\right)} \, dx\tag{1}$$

Wolfram Alpha is unable to simplify and solve it by itself. By applying the following general transformation formula:

$$\int f\left(x,\tan{\frac{\beta}{2}}, \tan{\frac{\gamma}{2}} \right)\,dx=\int f\left(\frac{e^{i\alpha}+e^{-i\alpha}}{2}a, e^{i\alpha}, \frac{1-e^{i\alpha}}{1+e^{i\alpha}}\right)\,\frac{e^{-i\alpha}-e^{i\alpha}}{2i}a\,d\alpha,\tag{2}$$

where $\alpha=\cos^{-1}\left(\frac{x}{a}\right)$, $\beta=\csc^{-1}\left(\frac{x}{a}\right)$ and $\gamma=\sec^{-1}\left(\frac{x}{a}\right)$, the integral $(1)$ becomes

$$=-\frac{i}{2}\int\frac{e^{-i\alpha} - e^{i\alpha} - e^{2i\alpha} + 1}{e^{2i\alpha}+2e^{i\alpha}-1}\,d\alpha.$$

Then, let $u=e^{i\alpha}\implies du=ie^{i\alpha}\,d\alpha$. Then, putting terms over a common denominator, and factoring, we have

$$-\frac{i}{2}\int\frac{e^{-i\alpha} - e^{i\alpha} - e^{2i\alpha} + 1}{e^{2i\alpha}+2e^{i\alpha}-1}\,d\alpha=\frac12\int\frac{(u - 1) (u + 1)^2}{u^2 (u^2 + 2 u - 1)}\,du$$

At this point, we can proceed by applying partial fraction decomposition.

What other method do you have in mind to solve $(1)$?


Edit. The integral $(1)$ is defined for $(−\infty,−1) \cup [1,\infty) \setminus \{\sqrt{2}\}$. The method described above (now refined in the summary's blog post) provides a systematic approach to handle both subdomains. Indeed, for an integral of the form $$\int f\Biggl(x, \tan\Bigl(\tfrac{\beta}{2}\Bigr), \tan\Bigl(\tfrac{\gamma}{2}\Bigr)\Biggr) dx,$$ the transformation is $$\boxed{\begin{aligned}\int f\Biggl(x, \tan\Bigl(\tfrac{\beta}{2}\Bigr), \tan\Bigl(\tfrac{\gamma}{2}\Bigr)\Biggr) dx = \int f\Biggl(\frac{t^2+1}{2t}a - b,\; t,\; \pm\frac{1-t}{1+t}\Biggr)\,\frac{t^2-1}{2t^2}a\, dt,\end{aligned}}\tag{3}$$ where the choice of sign $\pm$ corresponds to the domain of $x$: Use the upper sign when $\tfrac{x+b}{a} \geq 1 $, use the lower sign when $ \tfrac{x+b}{a} \leq -1$.

To revert to $x$-terms after integrating with respect to $t$, use $$t = e^{\pm i\alpha} = \frac{x+b \mp \sqrt{(x+b)^2-a^2}}{a},$$ selecting the sign consistent with the branch used during substitution.

Solution. For $1\leq x<\sqrt{2}$ or $x>\sqrt{2}$, we apply the transformation formula $(3)$ in terms of $t$ to obtain $$\begin{aligned}\int\frac{1}{\tan\left(\frac{1}{2}\csc^{-1} (x)\right) - \tan\left(\frac{1}{2}\sec^{-1}(x)\right)} \, dx&=\int \frac{1}{t - \left(\frac{1 - t}{1 + t}\right)} \cdot \frac{t^2 - 1}{2t^2}\,dt\\&=\frac12\int\frac{(t - 1) (t + 1)^2}{t^2 (t^2 + 2 t - 1)}\,dt.\end{aligned}$$ At this point, we can proceed by applying partial fraction decomposition.

By formula $(3)$, if $e^{i\alpha} = \tfrac1t$ for $x < -1$, then an analogous calculation (using the lower sign) leads to $$\begin{aligned}\int\frac{1}{\tan\left(\frac{1}{2}\csc^{-1} (x)\right) - \tan\left(\frac{1}{2}\sec^{-1}(x)\right)} \, dx&=\int \frac{1}{\frac{1}{t} + \left(\frac{1 - t}{1 + t}\right)} \cdot \frac{t^2 - 1}{2t^2}\,dt\\&=\frac12\int\frac{(t + 1) (1 - t^2)}{t (t^2 - 2 t - 1)}\,dt.\end{aligned}$$ Again, one may proceed by partial fraction decomposition to evaluate the resulting integral.

I don't see a simpler method than the one described above to do this, considering the entire domain of $(1)$. Do you?

Integreek
  • 8,530
  • 4
    Note that $$\tan(\frac12\sec^{-1}x)= \sqrt{\frac{x-1}{x+1}},>>>>> \tan(\frac12\csc^{-1}x)= x-\sqrt{x^2-1} $$ – Quanto Apr 10 '24 at 12:31
  • 2
    Wolfram can actually finish the integral, see here. The problem is that it didn't understand your input - in general try not to use decimals (e.g. replace $0.5$ with $\frac12$). To do it manually I'd probably rewrite the integral as: $$\int\frac{1}{x-\sqrt{x^2-1}-\sqrt{\frac{x-1}{x+1}}}dx\overset{\frac{x-1}{x+1}=t^2}=4\int\frac{t}{(1+t)(1-t)^2(1-2t-t^2)}dt$$ Which should be straightforward. Also, an alternative substitution that can be used there is $x-\sqrt{x^2-1}=t$. – Zacky Apr 10 '24 at 12:47
  • @Zacky: But when I access your WA link, it also doesn't resolve (it says it times out). Are you using the PRO version? – Emmanuel José García Apr 10 '24 at 12:56
  • @EmmanuelJoséGarcía that's weird.. I don't have any PRO version, here's what I see: https://i.sstatic.net/AJO2fai8.png – Zacky Apr 10 '24 at 12:57
  • @Zacky: I have edited my question so that you can see what I see from your WA link. – Emmanuel José García Apr 10 '24 at 13:05
  • Apparently I also get timed out if I run it in the Spanish language, however, in English it seems to work perfectly. – Zacky Apr 10 '24 at 13:16
  • 1
    @Zacky: It works in English. That's weird indeed! – Emmanuel José García Apr 10 '24 at 13:16
  • 1
    Even more weird is that in Spanish it can evaluate $\int \tan\left(\frac{1}{2}\csc^{-1} (x)\right) dx$ and $\int \tan\left(\frac{1}{2}\sec^{-1} (x)\right) dx$ separately - so it's not a language barrier problem. – Zacky Apr 10 '24 at 13:24
  • @Zacky: However, WA (in English) is unable to compute this integral: $$\int \frac{{1 - \tan\frac{{\sec^{-1}x}}{2}}}{{1 + \tan\frac{{\sec^{-1}x}}{2}}}\sqrt{\tan\frac{\csc^{-1}x}{2}},dx.$$ The transformation $(2)$, however, makes it child's play. – Emmanuel José García Apr 10 '24 at 15:27
  • 1
    @EmmanuelJoséGarcía Yes, the substitution is good - it also seems that wolfram struggles with such integrals. An alternative is the substitution I mentioned above: $\frac{x-1}{x+1}=t^2$, which gives: $$\int\frac{{1 - \tan\frac{{\sec^{-1}x}}{2}}}{{1 + \tan\frac{{\sec^{-1}x}}{2}}}\sqrt{\tan\frac{\csc^{-1}x}{2}} dx\overset{\large \frac{x-1}{x+1}=t^2}=4\int \frac{t}{(1+t)^3\sqrt{1-t^2}}dt\overset{\large \frac{1-t}{1+t}=y^2}= \int(y^4-1)dy$$ – Zacky Apr 10 '24 at 20:39
  • @Zacky: Apparently, my method leads to a simpler partial fraction decomposition for the original integral. Compare the systems of equations (see here and here). It would be interesting to investigate if this technique is optimal for this type of integrals. – Emmanuel José García Apr 16 '24 at 11:39
  • Now, for some strange reason, WA is unable to solve the integral from my original question even when using English. – Emmanuel José García Dec 10 '24 at 16:20

1 Answers1

1

I’ll continue from the form you left off. We can avoid PFD by rewriting the numerator as follows:

$$\require{cancel}\begin{align}\int\frac{(x-1)(x+1)^2}{x^2(x^2+2x-1)}\mathrm dx&=\int\frac{(x-1)(x^2+2x-1+2)}{x^2(x^2+2x-1)}\mathrm dx\\&=\int\frac{x-1}{x^2}\mathrm dx+\int\frac{(2x-1)-1}{x^2(x^2+2x-1)}\mathrm dx \\&\overset{t=\frac1x}{=}\int\frac{\mathrm dx}{x}\cancel{-\int\frac{\mathrm dx}{x^2}}\cancel{+\int\frac{\mathrm dx}{x^2}}-\int\frac{\mathrm dx}{x^2+2x-1}-\int\frac{t^2\,\mathrm dt}{t^2-2t-1}\end{align}$$

These integrals are now straight-forward.

Integreek
  • 8,530