integration with \(\boldsymbol{t}\) substitution part 2

In my first "integration with tea" article, I took an entirely algebraic approach. In fact, though, there is a beautiful geometric point of view that has important consequences for understanding higher dimensions. So first of all, take a look at this video and describe what you see in as much detail as possible.

For each position of the blue cross on the blue line, how many green points on the circle are there? What does this tell us about the relationship between the infinite vertical line and the circle?

Mapping the blue cross to the green cross provides an exact match between the blue line and the green circle. Only one point on the circle is missing.

Which point is it, and where is the blue cross when the green is at that point?

The point \((-1,\,0)\) does not correspond to any point on the line, but the closer the blue cross gets to infinity in either direction, the closer the green cross gets to that point, either from above or from below.

Now we will explore the relationship in some detail. Take a look at this diagram.

image1

If this is a circle centre the origin and radius , use similar triangles and the equation of the circle to find \(x\) and \(y\) in terms of \(t\).

Here is an image to help:

image1

$$\begin{aligned} &y=t(1+x)\\[6pt] &x^2+y^2=1\\[6pt] \Rightarrow &x^2+t^2(1+x)^2=1\\[6pt] \Rightarrow &x^2+t^2+2t^2x+t^2x^2=1\\[6pt] \Rightarrow &(1+t^2)x^2+2t^2x+t^2-1=0\\ \end{aligned}$$

This tells us where the line and circle intersect, so use the fact that the line and circle intersect at \((-1,\,0)\) to factorise this quadratic.

\(x+1\) must be a factor, so that $$\begin{aligned} &(x+1)\left(\left(1+t^2\right)x+t^2-1\right)=0\\[6pt] \Rightarrow &x=\frac{1-t^2}{1+t^2} \end{aligned}$$ Then $$\begin{aligned} y&=t(1+x)\\[6pt] &=t\left(1+\frac{1-x^2}{1+x^2}\right)\\[6pt] &=\frac{2t}{1+t^2} \end{aligned}$$

image3

Now find \(t\) in terms of \(\theta\)

image4

Angle at the circumference is half the angle at the centre, so $$t=\tan\frac{\theta}{2}$$

image5

Use this diagram to find two expressions for \(t\) in terms of \(\cos\theta\) and \(\sin\theta\).

image6

$$\tan\frac{\theta}{2}=\frac{\sin\theta}{1+\cos \theta}=\frac{1-\cos \theta}{\sin\theta}$$

image7

Now, we'll go back to using this as the basis for substitutions in integrals. Remember that $$\begin{aligned} &\sin x=\frac{2t}{1+t^2}\\[6pt] &\cos x=\frac{1-t^2}{1+t^2}\\[6pt] &\tan x=\frac{2t}{1-t^2}\\ \end{aligned}$$ and that $$\begin{aligned} &t=\tan\frac{x}{2}\\[6pt] \Rightarrow &\frac{\mathrm{d}t}{\mathrm{d}x}=\frac{1}{2}\sec^2\frac{x}{2}\\[6pt] &\phantom{\frac{\mathrm{d}t}{\mathrm{d}x}}=\frac{1+t^2}{2}\\[6pt] \Rightarrow &\frac{\mathrm{d}x}{\mathrm{d}t}=\frac{2}{1+t^2}\\ \end{aligned}$$

Find $$\int \frac{1}{1+\sin x}\,\mathrm{d}x$$

$$\begin{aligned} \int\frac{1}{1+\sin x}\,\mathrm{d}x&=\int\frac{1}{1+\frac{2t}{1+t^2}}\frac{2}{1+t^2}\,\mathrm{d}t\\[6pt] &=\int\frac{2}{1+t^2+2t}\,\mathrm{d}t\\[6pt] &=\int\frac{2}{(1+t)^2}\,\mathrm{d}t\\[6pt] &=-\frac{2}{1+t}\\[6pt] &=-\frac{2}{1+\tan\frac{x}{2}} \end{aligned}$$

Here's another approach. Remember from the previous article that $$\int \frac{1}{1+\cos x}\,\mathrm{d}x=\tan \frac{x}{2}$$.

Use this and the fact that \(\displaystyle{\sin x=\cos\left(\frac{\pi}{2}-x\right)}\) to find \(\displaystyle{\int \frac{1}{1+\sin x}\,\mathrm{d}x}\).

$$\begin{aligned} \int\frac{1}{1+\sin x}\,\mathrm{d}x&=\int\frac{1}{1+\cos\left(\frac{\pi}{2}-x\right)}\,\mathrm{d}t&u=\frac{\pi}{2}-x\\[6pt] &=-\int\frac{1}{1+\cos u}\,\mathrm{d}u\\[6pt] &=-\tan\frac{u}{2}\\[6pt] &=-\tan\left(\frac{\pi}{4}-\frac{x}{2}\right)\\[6pt] &=\tan\left(\frac{x}{2}-\frac{\pi}{4}\right)\\ \end{aligned}$$ We can rewrite this as $$\begin{aligned} \tan\left(\frac{x}{2}-\frac{\pi}{4}\right)&=\frac{t-\tan\frac{\pi}{4}}{1+t\times\tan\frac{\pi}{4}}\\[6pt] &=\frac{t-1}{t+1}\\[6pt] &=\frac{\tan\frac{x}{2}-1}{\tan\frac{x}{2}+1} \end{aligned}$$

Are the two expressions resulting from the two different methods the same?

The two expressions are $$\frac{t-1}{t+1}$$ and $$-\frac{2}{1+t}$$

Subtract one of these expressions from the other.

$$\frac{t-1}{1+t}+\frac{2}{1+t}=1$$

Why does this mean that these are both valid versions of the integral?

Since they differ by a constant, the difference is absorbed into the "\(+c\)".

Remember again from the previous article that $$\int \frac{1}{1+\cos x}\,\mathrm{d}x=\frac{\sin x}{1+\cos x}$$ and $$\int \frac{1}{1+\cos x}\,\mathrm{d}x=\frac{1-\cos x}{\sin x}$$

Use these two results to find similar expressions for $$\int\frac{1}{1+\sin x}\,\mathrm{d}x$$.

$$\begin{aligned} \int\frac{1}{1+\sin x}\,\mathrm{d}x&=\int\frac{1}{1+\cos\left(\frac{\pi}{2}-x\right)}\,\mathrm{d}t&u=\frac{\pi}{2}-x\\[6pt] &=-\int\frac{1}{1+\cos u}\,\mathrm{d}u\\[6pt] &=-\frac{\sin u}{1+\cos u}\\[6pt] &=-\frac{\cos x}{1+\sin x}\\ \end{aligned}$$ and $$\begin{aligned} \int\frac{1}{1+\sin x}\,\mathrm{d}x&=\int\frac{1}{1+\cos\left(\frac{\pi}{2}-x\right)}\,\mathrm{d}t&u=\frac{\pi}{2}-x\\[6pt] &=-\int\frac{1}{1+\cos u}\,\mathrm{d}u\\[6pt] &=\frac{\cos u-1}{\sin u}\\[6pt] &=\frac{\sin x-1}{\cos x}\\ \end{aligned}$$

For this integral: $$\int \frac{1}{\sin x+\cos x}\,\mathrm{d}x$$ I can find the following versions, among others:

$$\begin{aligned} \int \frac{1}{\sin x+\cos x}\,\mathrm{d}x&=\frac{1}{\sqrt 2}\ln \left|\frac{\sqrt 2 +t-1}{\sqrt 2 -t+1}\right|\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\sec \left(x-\frac{\pi}{4}\right)+\tan \left(x-\frac{\pi}{4}\right)\right|\\[6pt] &=\frac{1}{\sqrt 2}\ln \left|\tan\left(\frac{x}{2}+\frac{\pi}{8}\right)\right|\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\frac{t+\sqrt 2-1}{t-t\sqrt 2+1}\right|\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\mathrm{cosec}\, \left(x+\frac{\pi}{4}\right)-\cot \left(x+\frac{\pi}{4}\right)\right|\\ &=\frac{1}{\sqrt 2}\ln\left|\frac{\sin\left(x+\frac{\pi}{4}\right)}{1+\cos\left(x+\frac{\pi}{4}\right)}\right|\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\frac{1-\cos\left(x+\frac{\pi}{4}\right)}{\sin\left(x+\frac{\pi}{4}\right)}\right|\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\frac{1-\sin\left(x-\frac{\pi}{4}\right)}{\cos\left(x-\frac{\pi}{4}\right)}\right|\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\frac{\cos\left(x-\frac{\pi}{4}\right)}{1+\sin\left(x-\frac{\pi}{4}\right)}\right| \end{aligned}$$

Find each of these expressions by some integration method, and show that they are essentially equivalent.

$$\begin{aligned} \int\normalsize \frac{1}{\sin x+\cos x}\,\mathrm{d}x&=\int \frac{1}{\frac{2t}{1+t^2}+\frac{1-t^2}{1+t^2}}\times \frac{2}{1+t^2}\,\mathrm{d}t\\[6pt] &=\int\frac{2}{1+2t-t^2}\,\mathrm{d}t\\[6pt] &=\int \frac{2}{2-(t-1)^2}\,\mathrm{d}t\\[6pt] &=\int\frac{2}{\left(\sqrt 2 +t-1\right)\left(\sqrt 2 -t+1\right)}\,\mathrm{d}t\\[6pt] &=\frac{1}{\sqrt 2}\int\frac{1}{\sqrt 2+t-1}+\frac{1}{\sqrt 2 -t+1}\,\mathrm{d}t\\[6pt] &=\frac{1}{\sqrt 2}\ln \frac{\sqrt 2 +t-1}{\sqrt 2 -t+1} \end{aligned} $$

$$\begin{aligned} \int \frac{1}{\sin x+\cos x}\,\mathrm{d}x&=\int \frac{1}{\sqrt 2 \cos \left(x-\frac{\pi}{4}\right)}\,\mathrm{d}x&u=x-\frac{\pi}{4}\\[6pt] &=\int \frac{1}{\sqrt 2 \cos u}\,\mathrm{d}u&w=\sec u+\tan u\\ &&\frac{\mathrm{d}w}{\mathrm{d}u}=\sec u\tan u+\sec^2 u=\sec u(\tan u+\sec u)\\[6pt] &=\int \frac{1}{\sqrt 2 \cos u}\frac{1}{\sec u(\tan u+sec u)}\,\mathrm{d}w\\[6pt] &=\int \frac{1}{w}\,\mathrm{d}w\\[6pt] &=\ln |w|\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\sec \left(x-\frac{\pi}{4}\right)+\tan \left(x-\frac{\pi}{4}\right)\right|\\ \end{aligned}$$

$$\begin{aligned} \int \frac{1}{\sin x+\cos x}\,\mathrm{d}x&=\int \frac{1}{\sqrt 2 \sin \left(x+\frac{\pi}{4}\right)}\,\mathrm{d}x\\[6pt] &=\frac{1}{\sqrt 2}\ln\left|\mathrm{cosec}\, \left(x+\frac{\pi}{4}\right)-\cot \left(x+\frac{\pi}{4}\right)\right|\\ \end{aligned}$$

$$\begin{aligned} \int \frac{1}{\sin x+\cos x}\,\mathrm{d}x&=\int \frac{1}{\sqrt 2 \sin \left(x+\frac{\pi}{4}\right)}\,\mathrm{d}x &u=x+\frac{\pi}{4}\\[6pt] &=\int \frac{1}{\sqrt 2 \sin u}\,\mathrm{d}x &t=\tan\frac{u}{2}\\[6pt] &=\frac{1}{\sqrt 2}\int \frac{1+t^2}{2t}\frac{2}{1+t^2}\,\mathrm{d}t\\[6pt] &=\frac{1}{\sqrt 2}\int \frac{1}{t}\,\mathrm{d}t\\[6pt] &=\frac{1}{\sqrt 2}\ln t\\[6pt] &=\frac{1}{\sqrt 2}\ln \tan\left(\frac{x}{2}+\frac{\pi}{8}\right)\\[6pt] &=\frac{1}{\sqrt 2}\ln \frac{t+\tan\frac{\pi}{8}}{1-t\times\tan\frac{\pi}{8}}\\[6pt] &=\frac{1}{\sqrt 2}\ln \frac{t+\sqrt 2-1}{t-t\sqrt 2 +1} \end{aligned}$$

It's not easy to see that these two are equivalent: $$\begin{aligned} &\frac{1}{\sqrt 2}\ln \frac{\sqrt 2 +t-1}{\sqrt 2 -t+1}\\[6pt] &\frac{1}{\sqrt 2}\ln\frac{t+\sqrt 2-1}{t-t\sqrt 2+1}\\[6pt] \end{aligned} $$

Show that these two solutions differ by a constant.

$$\begin{aligned} \ln \frac{\sqrt 2 +t-1}{\sqrt 2 -t+1}-\ln\frac{t+\sqrt 2-1}{t-t\sqrt 2+1} &=\ln \frac{t-t\sqrt 2+1}{\sqrt 2 -t+1}\\[6pt] &=\ln \frac{\left(\sqrt 2-1\right)\left(\sqrt 2 +t-1\right)}{\sqrt 2 +t-1}\\[6pt] &=\ln {\left(\sqrt 2 -1\right)} \end{aligned}$$