6

I see in a calculus textbook that, for $|A| \neq 1$, \begin{align} f(x) &\equiv \int \frac{1}{A + \cos x} \,\text{d}x \\&=\frac{1}{ \sqrt{A^2 - 1} } \left( x - 2 \tan^{-1} \frac{ \sin x }{ A + \sqrt{A^2 - 1} + \cos x } \right) \end{align} which I have verified using Mathematica

$$\frac{\text{d}\, f(x)}{\text{d}\, x} = \frac{1}{A + \cos x}$$

However, I have failed to show the equivalence (up to a constant) of $f(x)$ to the more sensible form obtained by Mathematica (as explained here): $$g(x) \equiv \int \frac{1}{A + \cos x} \,\text{d}x = \frac{-2}{\sqrt{1-A^2}} \tanh ^{-1}\frac{(A-1) \tan \frac{x}{2}}{\sqrt{1-A^2}}$$ With the half angle substitution, one can replace $\tan \frac x2$ in above result. However, what really stumps me is how to get the linear term and arctangent in $f(x)$. It seems reasonable to try some identities involving inverses like $$\tanh^{-1}(\sin x) = \sinh^{-1}(\tan x) $$ or equivalently $$ \sin^{-1}( \tanh x ) = \tan^{-1}( \sinh x )$$ together with some common ways to combine $\sin x$ and $\cos x$. But, so far, I have gotten nowhere.

Quanto
  • 97,352
  • 1
    If $A>1$, the integrand is continuous on $\Bbb R$, so an antiderivative should be also continuous of $\Bbb R$. This is a known problem with the $\tan(x/2)$ change of variable. And this is a know problem of computer algebra systems. See this, and if you have access to the article linked to in the comments, have a look! – Jean-Claude Arbaut Oct 12 '16 at 05:48
  • @Jean-ClaudeArbaut Can't help but wonder how many known computer algebra issues that I'm not aware of! Great info. That's a good post btw. – Lee David Chung Lin Oct 12 '16 at 06:18
  • 1
    Does the accepted answer below address the question? My impression is that it does not even touch on the "equivalence" problem you ask about in the title and in the body. Please explain. – Did Dec 07 '16 at 10:15
  • @Did you're right. I accepted it solely out of courtesy. – Lee David Chung Lin Dec 07 '16 at 10:19
  • What a strange reason. In practice, accepting an answer basically closes the question. In the present case, it prevented you to get anybody actually answering the question. Furthermore, I note you received an answer after 40 minutes and accepted it 38 minutes later. That means you voluntarily limited the exposition of your question to a total time span of less than 1.5 hours. Strange choice. – Did Dec 07 '16 at 10:52
  • @Did I appreciate you taking interest in this question. It was a reluctant choice I made for the following reasons: (a) most posts get washed away very soon and I had bad experiences before this post when I waited for other people to contribute (b) back then I felt like maybe it was my bad that I didn't phrase the question so that others can understand, while to myself it's pretty clear and there's not much I could improve (c) it's just a technical algebraic manipulation for an integration and not a big deal. They responded pretty quickly (within an hour) and that signaled to me they... – Lee David Chung Lin Dec 07 '16 at 11:11
  • @Did ...felt strongly about this. I didn't want to push it and appear rude so I backed off. $~~~~$ Yeah as of now I still am a bit curious about it and would be very happy to get a real answer to my original inquiry. – Lee David Chung Lin Dec 07 '16 at 11:15
  • @Did ...... so .... Is it that you have a good idea for this question? If you feel like posting an answer but I've already "accepted" one, sort of a demotivation of not allowing the proper credit, I will try to explain this to Claude Leibovici and do the unthinkable of "unchecking" his answer. – Lee David Chung Lin Dec 07 '16 at 11:29
  • 1
    Re the mathematics, your remark that "with the half angle substitution one can obtain the argument $u$ as in $f(x)$ above" clearly points to the right direction. You might have missed the fact that one of the formulas holds for $|A|<1$ and the other for $|A|>1$ hence their equivalence probably follows from the remark that the circular lines evaluated at $x$ correspond to the hyperbolic ones evaluated at $ix$. But I confess not being interested enough to study this further. – Did Dec 07 '16 at 12:23
  • Re the site itself, you seem to have developed a set of false beliefs about the proper ways to behave here. My advice would be to compare them with the content on some pages about the ways the site is actually supposed to work, "howtoask" and the like. To summarize what is explained there, to get mathematically correct answers actually addressing the question should come first and foremost, always. In particular, accepting quickly answers is explicitely discouraged and unaccepting them is a rather banal act, certainly not the big fuss you make it to be. – Did Dec 07 '16 at 12:28
  • @Did Thank you for the reminder. I know that you're addressing this post as well as the other recent post (wrong answer) of mine. Yeah I sometimes still get carried away by the mentality of "scoring" and get hot headed, even though I actually have read a lot about how many people don't like stackExchange (esp. stackOverflow) and prefer e.g. Quora. – Lee David Chung Lin Dec 07 '16 at 12:39
  • One can start with https://www.wolframalpha.com/input?i=iarctanhix then can continue. – Bob Dobbs Jun 22 '23 at 14:46

2 Answers2

2

The equivalence of $g(x)$ and $f(x)$ can indeed be established, as shown below.

\begin{align} g(x) &= \frac{-2}{\sqrt{1-A^2}} \tanh ^{-1}\frac{(A-1) \tan \frac{x}{2}}{\sqrt{1-A^2}}\\ &= \frac{2}{\sqrt{A^2-1}} \tan^{-1}\frac{(A-1) \tan \frac{x}{2}}{\sqrt{A^2-1}}\\ &= \frac{2}{\sqrt{A^2-1}} \bigg(\frac x2 -\tan^{-1}\tan\frac x2+\tan^{-1}\frac{(A-1) \tan \frac{x}{2}}{\sqrt{A^2-1}}\bigg)\\ &= \frac{1}{\sqrt{A^2-1}} \bigg(x-2\tan^{-1}\frac{\sqrt{A^2-1} -A+1}{\sqrt{A^2-1}\cot\frac x2+(A-1)\tan\frac x2}\bigg)\\ \end{align} Next, utilize $\tan\frac x2=\frac{1-\cos x}{\sin x}$ and $\cot\frac x2=\frac{1+\cos x}{\sin x}$, as well as $$\frac{\sqrt{A^2-1}+A-1}{\sqrt{A^2-1}-A+1}= A+ \sqrt{A^2-1}$$ to arrive at \begin{align} g(x) &= \frac{1}{\sqrt{A^2-1}} \bigg(x-2\tan^{-1}\frac{\sin x}{A+\sqrt{A^2-1}+\cos x}\bigg)=f(x) \end{align}

Quanto
  • 97,352
1

There are several ways to compute $$I=\int \frac{dx}{A + \cos x} $$ Using the tangent half-angle substitution $t=\tan \left(\frac{x}{2}\right)$, it reduces to $$I=2\int \frac{dt}{(A-1) t^2+(A+1)}=\frac 2{A-1}\int\frac{dt}{t^2+\frac{A+1}{A-1}}$$ So, now, using $$t=\sqrt{\frac{A+1}{A-1}}u\implies I=\frac{2 }{\sqrt{A-1} \sqrt{A+1}}\tan ^{-1}\left(\frac{\sqrt{A-1} }{\sqrt{A+1}}t\right)$$ but,as you can see, there could be some problem depending on the value of $A$. If $A >1$, I think that this is the best form to use.

If $A<1$, the argument of the tangent becomes an imaginary number but we can use the identity $\tan(i \theta)=i\tanh(\theta)$ and the the second formula.

  • Not the best form when $A>1$, as you get a periodic discontinuous function, while the integrand is continuous and positive on $\Bbb R$ (so there is a continuous and increasing antiderivative on $\Bbb R$). See my comment above :) However, the most common way to tackle such an integral, maybe. – Jean-Claude Arbaut Oct 12 '16 at 05:50
  • @Jean-ClaudeArbaut. You are totally correct indeed. Cheers. – Claude Leibovici Oct 12 '16 at 05:52
  • Dr. Leibovici, if you're still around, please pardon me that I need to un-accept this answer. The question was posted five years ago when I first started using this site, and as such I made a mistake in hastily accepting your answer. Please read the comments under the question post, a dialogue between Did and I. Now I need to rectify this mistake of mine. If you still care about this problem enough, you are more than welcomed to make an edit and provide an answer. Again, sincere apology. – Lee David Chung Lin Nov 15 '21 at 22:59
  • Now to the math: even though I agree with what you said about "...this is the best form to use", finding out how the two forms can be derived from one to the other is very much the main inquiry of the question post. – Lee David Chung Lin Nov 15 '21 at 23:09