# How can this substitution be valid in general?

$$I=\int\frac{1}{2+\cos\theta}d\theta$$

When trying to solve this integral my calculus-book states that we can use the following substitution:

$$x=\tan(\theta/2)$$$$\cos\theta=\frac{1-x^2}{1+x^2}$$$$d\theta=\frac{2dx}{1+x^2}$$

This substitution results in this easier to solve integral:

$$I=\int\frac{2}{3+x^2}dx$$

My question is about the validity of this substitution for values where $x$ does not exist, for example at $\theta=\pi$, at which $\tan(\theta/2)$ is not defined.

I don't understand how the substitution can be valid in general while $x$ is not defined for all values of $\theta$.

See the Geometry part of wiki thread. It describes the parameterization in detail. In particular, it says the point never reaches the point $(−1,0)$. So you're correct. $x$ is not defined when $\theta$ approached $\pi$.

Intuitively, for me, any tri-sub(including tangent substitution) is just a kind of "transformation".

Hope this makes some sense to you.

• Ah, the second example on the wiki site basically answers my question. – GambitSquared Apr 21 '18 at 19:16

first find out the final function after integration. you notice that if you put θ= pi in the function the answer is not undefined.

• That feels a bit unsatisfactory: so we just happen to find out it works regardless? There must be a deeper explanation of what is going on here? – GambitSquared Apr 21 '18 at 18:50
• oh k so you want to know why all the substitution like this won`t be undefined.? – Avnish Singh Apr 21 '18 at 18:51
• that would require some thinking, ha – Avnish Singh Apr 21 '18 at 18:52
• "its the beauty of maths" would be a vague answer, i guess – Avnish Singh Apr 21 '18 at 18:52

The substitution isn't valid, in general, due to not every $x$ mapping to a value of $\theta$. When it isn't valid, you should find inconsistencies. When this occurs, use a different substitution.