Note that the last example I gave in class today can be done in a much simpler way which doesn’t involve a trig substitution. I will include both the way we did it in class as well as the simpler way below. Thank you to the student who came and pointed this out!


Today we looked at integrals of non-trigonometric functions for which substituting in some trig expression makes the undoable doable. Let’s start with the example:




I drew a quick sketch of this function, just because it’s good exercise to do that. You see that the denominator is the expression for a unit upper half semi-circle centred at the origin. Inverting this (ie. \frac{1}{circle} gives a graph which passes through the point (0,1) and asymptotes to infinity at \pm 1.


Whenever we see something of the form 1-x^2 we should be reminded of the trig identity 1-\sin^2\theta=\cos^2\theta because this will simplify things. In order to get the expression into this form we will make the substitution x=\sin u and thus dx=\cos u du. We also restrict -\frac{\pi}{2}\le u\le \frac{\pi}{2}. This means that the substitution is one to one and thus invertible, and that \cos u is positive. Note that we could have chosen \cos instead of \sin. This would give an equivalent (though slightly different looking) answer in the end. Substituting this into the integral gives:


\int \frac{1}{\sqrt{1-\sin^2 u}}\cos u du=\int\frac{1}{\sqrt{\cos^2u}}\cos u du


Because of the region of u that we have chosen \sqrt{\cos^2 u}=\cos u and we are left with:


\int 1 du=u+c=\arcsin x+c


Note that had we chosen to use u=\cos x we would have arrived at the answer -\arccos x+c which is the same, up to a constant.


Example involving a \sec substitution:


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


We start by writing this as:


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


(Make sure that you can do this). Now, again we want to use our most basic of trig identities, but to do this we have to let \frac{1}{x}=\cos u, ie. x=\sec u\longrightarrow dx=\frac{\sin u}{\cos^2 u} du. In this case we need to make the choice that 0\le u<\frac{\pi}{2} or \pi\le u<\frac{3\pi}{2}. Substituting this in, we get:


\int \sqrt{1-\cos^2 u}\frac{\sin u}{\cos^2 u} du=\int \frac{\sin^2 u}{\cos^2 u} du


We’re now going to use a trick, because I can’t usually remember this integral off hand. We will add and subtract 1:


\int \frac{\sin^2 u}{\cos^2 u} du=\int \frac{\sin^2 u+cos^2 u}{\cos^2 u}-1 du=\int \sec^2 u-1 du=\tan u-u+c


But our original substitution was in terms of \cos u so it would be useful to write \tan in terms of \cos. We have:


\int\frac{\sqrt{x^2-1}}{x} dx = \tan u-u+c=\frac{\sqrt{1-\cos^2 u}}{\cos u}-u+c


Now we can substitute directly for \cos u to get:


\int\frac{\sqrt{x^2-1}}{x} dx=x\sqrt{1-\frac{1}{x^2}}-\arccos \frac{1}{x}+c=\sqrt{x^2-1}-\arccos \frac{1}{x}+c


An example with an unspecified constant


Let’s look at an example with:




Where a is a constant. Again, we see that to use our normal trig identity we will want to set x=a\sin u\longrightarrow dx=a\cos u du, again with -\frac{\pi}{2}\le u\le \frac{\pi}{2}. Substituting this in we get:


\int a\sqrt{1-\sin^2u} a\cos u du=\int a^2\cos^2u du


Now we use the double angle formula for \cos^2u=\frac{1}{2}(\cos (2u)+1) to get:


\frac{a^2}{2}\int (1+\cos(2u)) du=\frac{a^2}{2}\left(u+\frac{\sin(2u)}{2}\right)+c


Now we again use a double angle formula, this time for \sin (2u)=2\sin u\cos u=2\sin u\sqrt{1-\sin^2 u} to get:


\frac{a^2}{2}\left(u+\sin u\sqrt{1-\sin^2 u}\right)+c


Now substitute back in to get:


\frac{a^2}{2}\left(\arcsin \frac{x}{a}+\frac{x}{a}\sqrt{1-\frac{x^2}{a^2}}\right)+c


An integral the easy way or the hard way


In class we did this integral the hard way, but as pointed out, there’s a much better route. We’ll start off the hard way and then see the clear shortcut. In fact this is going to be an example of a method that we’ll use in the coming lecture on integration by partial fractions.


\int \frac{dt}{t^2+6t+8}


We start by completing the square in the denominator:


\int \frac{dt}{(t+3)^2-1}


We’ll now make life a bit trickier for ourselves by letting t+3=\sin\theta\longrightarrow dt=\cos\theta d\theta with -\frac{\pi}{2}\le\theta\le\frac{\pi}{2}. This gives us:


\int \frac{\cos\theta}{\sin^2\theta-1}d\theta=-\int\sec\theta d\theta=-\ln|\sec\theta+\tan\theta|+c


We can now rewrite these trig functions in terms of \sin\theta to give:




We can now square what’s inside the logarithm and then take the square root, which is equivalent to multiplying the log by \frac{1}{2}. Remember that a \ln x=\ln x^a:




Now we substitute back in to get:




Now in fact we could have solved this an easier way by spotting that:


\int \frac{dt}{(t+3)^2-1}=\int\frac{dt}{(t+4)(t+2)}=\frac{1}{2}\int \frac{1}{t+2}-\frac{1}{t+4} dt=\frac{1}{2}\ln|\frac{t+2}{t+4}|


The trick to get the penultimate step is something that we will see next time in a lot more detail!


An example we didn’t see in class


How about:


\int \frac{x}{1-x^4} dx


to get this into the form where we can use our trig identity we will need to identify x^2=\sin \theta\longrightarrow 2x dx=\cos\theta d\theta with -\frac{\pi}{2}\le\theta\le\frac{\pi}{2}. This substitution will then lead to:


\frac{1}{2}\int\sec\theta d\theta=\frac{1}{2}\ln|\sec\theta+\tan\theta|+c


Again, writing everything in terms of \sin\theta we can manipulate the final expression into (show this, I’m not going to fill in all the steps on this one…):




Where we used a very similar trick to the previous \ln example.

Try this one:



For general a, b and c.

More exercises


For more examples take a look at:

See here for other, more intuitive ways to evaluate the \sec integral which was asked about last time.

There will be more bonus material on prime numbers next time, too!


How clear is this post?