# Integral of sec²(x)|Two ways

Hi everyone! I know it’s been a really long time since my last post, but lessons during COVID-19 really had me busy and stressed out… but here I am again! Hope you are all doing great and ready for more integrals!

In this post I am going to show you two methods I found to integrate the function y=sec²x. The first one requires a bit of knowledge about trigonometry and trigonometric identities and might not be very intuitive, whereas the second involves a substitution right at the beginning and then some algebra and trigonometric identities. Feel free to share more methods if you know them!

First method

$\int&space;\sec^2(x)\,\mathrm{d}x$

First of all, what is sec(x) equal to? It’s simply the reciprocal of the function cos(x), i.e. 1/cos(x). Therefore, secant squared is equal to one over cosine squared. That simple!

$\int&space;\frac{1}{\cos^2(x)}\,\mathrm{d}x$

Now comes the not very intuitive part. In trigonometry, 1 is given by the sum of the squares of the two fundamental functions sine and cosine. This is the most important trigonometric identity and the one we are going to use:

$\int\frac{\sin^2(x)+\cos^2(x)}{\cos^2(x)}\,\mathrm{d}x$

At this point we basically have

$\int\left&space;[\frac{\sin^2(x)}{\cos^2(x)}+\frac{\cos^2(x)}{\cos^2(x)}&space;\right&space;]\mathrm{d}x$

It’s like (a+b)*(1/c)=a/c+b/c: we are simply distributing the 1/c.

$\int\left&space;[\frac{\sin^2(x)}{\cos^2(x)}+1&space;\right&space;]\mathrm{d}x$

Let’s apply linearity:

$\int\frac{\sin^2(x)}{\cos^2(x)}\,\mathrm{d}x&space;+\int&space;1\,&space;\mathrm{d}x$

Remember the property

$\int&space;m\,\mathrm{d}x=mx+C$

where m is a constant, in our case 1; therefore

$x+\int\frac{\sin^2(x)}{\cos^2(x)}\,\mathrm{d}x$

The problem here is mostly the fact that we have sine squared at the numerator. If it was simply sin(x), we would have performed a u-substitution by letting u=cos(x) and its derivative, -sin(x), would have gone to the denominator and so it would have cancelled out with the sin(x) on top.

$\int\frac{\sin(x)}{\cos^2(x)}\,\mathrm{d}x$ $u=\cos(x)\;\;\;\;\;\mathrm{d}u=-\sin(x)\mathrm{d}x\rightarrow&space;\mathrm{d}x=-\frac{\mathrm{d}u}{\sin(x)}$ $\int&space;\frac{{\color{Red}&space;\sin(x)}}{\cos^2(x)}\left&space;(&space;-\frac{1}{{\color{Red}&space;\sin(x)}}&space;\right&space;)\mathrm{d}u$ $\int&space;\frac{{\color{Red}&space;\sin(x)}}{u^2}\left&space;(&space;-\frac{1}{{\color{Red}&space;\sin(x)}}&space;\right&space;)\mathrm{d}u$

Notice that cos²(x) becomes u² because we let u=cos(x).

$-\int&space;\frac{1}{u^2}\,\mathrm{d}u=-\int&space;u^{-2}\,\mathrm{d}u$

Let’s apply the power rule for integrals. Just in case you don’t remember,

$\int&space;x^n\,\mathrm{d}x=\frac{x^{n+1}}{n+1}+C$ $-&space;\frac{u^{-1}}{-1}\,\mathrm{d}u=u^{-1}=\frac{1}{u}$

Let’s undo the substitution (remember: u=cos(x))

$\int&space;\frac{\sin(x)}{\cos^2(x)}\,\mathrm{d}x=\frac{1}{\cos(x)}+C$

BUT we don’t have this integral; instead we have

$x+\int&space;\frac{\sin^2(x)}{\cos^2(x)}\,\mathrm{d}x$

But after all, sin²(x) is sin(x)*sin(x), so:

$\int&space;\sin(x)\cdot&space;\frac{\sin(x)}{\cos^2(x)}\,\mathrm{d}x$

We have a product, which means we can perform integration by parts, and naturally we are going to differentiate sin(x) and integrate the other term, since we have already found the antiderivative (1/cos(x));

$u=\sin(x)\;\;\;\;\mathrm{d}v=\frac{\sin(x)}{\cos^2(x)}\,\mathrm{d}x$ $\mathrm{d}u=\cos(x)\,\mathrm{d}x\;\;\;\;v=\frac{1}{\cos(x)}$

Remember that

$\int&space;u\,\mathrm{d}v=uv-\int&space;v\,\mathrm{d}u$

Therefore,

$\frac{\sin(x)}{\cos(x)}-\int&space;\cos(x)\cdot&space;\frac{1}{\cos(x)}\,\mathrm{d}x$ $\frac{\sin(x)}{\cos(x)}-\int&space;1\,\mathrm{d}x$ $\frac{\sin(x)}{\cos(x)}-x$

This is the result of

$\int&space;\frac{\sin^2(x)}{\cos^2(x)}\,\mathrm{d}x$

but we also have that x from the first part of the integration:

$\int&space;\sec^2(x)\,\mathrm{d}x=x+\int&space;\frac{\sin^2(x)}{\cos^2(x)}\,\mathrm{d}x=x+\frac{\sin(x)}{\cos(x)}-x=\frac{\sin(x)}{\cos(x)}$

sin(x)/cos(x) is tan(x); finally,

$\int&space;\sec^2(x)\,\mathrm{d}x=\tan(x)+C$

Second method

$\int&space;\sec^2(x)\,\mathrm{d}x$

This time we are going to let u be sec(x), so that sec²(x) becomes u²:

$u=\sec(x)\;\;\;\;\;\;\mathrm{d}u=\frac{\sin(x)}{\cos^2(x)}\,\mathrm{d}x$

sec(x) is 1/cos(x), so in order to differentiate it we apply the reciprocal rule:

$\frac{\mathrm{d}&space;}{\mathrm{d}&space;x&space;}\frac{1}{f(x)}=-\frac{f'(x)}{[f(x)]^2}$

Therefore,

$\frac{\mathrm{d}&space;}{\mathrm{d}&space;x&space;}\frac{1}{\cos(x)}=-\frac{-\sin(x)}{\cos^2(x)}=\frac{\sin(x)}{\cos^2(x)}$

Now, there is a problem: if we substitute we must integrate with respect to the new variable, u in our case, which means every function of the “old” variable x must be written in terms of u. We have

$\small&space;u=\sec(x)=\frac{1}{\cos(x)},&space;{\color{Red}&space;u^2}={\color{Red}&space;\frac{1}{\cos^2(x)}}&space;\,\,\text{and&space;}&space;\mathrm{d}u=\frac{\sin(x)}{\cos^2(x)}\,\mathrm{d}x=\sin(x)\cdot&space;{\color{Red}&space;\frac{1}{\cos^2(x)}}\,\mathrm{d}x$

The terms in red are simply u²:

$\small&space;\mathrm{d}u=\sin(x)\cdot&space;u^2\,\mathrm{d}x$

We’re almost there. How can we write sin(x) using cos²(x)? Remember the identity sin²(x)+cos²(x)=1:

$\small&space;\sin^2(x)+\cos^2(x)=1\rightarrow&space;\sin^2(x)=1-\cos^2(x)\rightarrow&space;\sin(x)=\sqrt{1-\cos^2(x)}$

We know that u²=1/cos²(x), therefore cos²(x)=1/u²:

$\sin(x)=\sqrt{1-\cos^2(x)}\xrightarrow[]{\cos^2(x)=\frac{1}{u^2}}\sin(x)=\sqrt{1-\frac{1}{u^2}}$

This means

$\mathrm{d}u=u^2\sqrt{1-\frac{1}{u^2}}\,\mathrm{d}x$ $\mathrm{d}u=u^2\sqrt{\frac{u^2-1}{u^2}}\,\mathrm{d}x$ $\mathrm{d}u=\frac{u^2}{u}\sqrt{u^2-1}\,\mathrm{d}x$ $\mathrm{d}u=u\sqrt{u^2-1}\,\mathrm{d}x$

Let’s give a look at the integral:

$\int&space;u^2\,\mathrm{d}x$

We want dx, therefore

$\mathrm{d}u=u\sqrt{u^2-1}\,\mathrm{d}x\rightarrow&space;\mathrm{d}x=\frac{\mathrm{d}u}{u\sqrt{u^2-1}}$ $\int&space;u^2\frac{\mathrm{d}u}{u\sqrt{u^2-1}}=\int&space;\frac{u}{\sqrt{u^2-1}}\,\mathrm{d}u$

This is exactly what we wanted, no more x‘s. At this point what do you think we can do? Give it a try and then keep reading to see if you got it right.

This is what we are going to do: if you differentiate u²-1, you’ll get 2u, which will be the du but, since we want dx, it will “become” 1/2u and so it will cancel out with the u at the numerator. Since we used u before, we’ll change variable.

$t=u^2-1\;\;\;\;\;\;\mathrm{d}t=2u\,\mathrm{d}u\rightarrow&space;\mathrm{d}u=\frac{\mathrm{d}t}{2u}$ $\int&space;\frac{{\color{Red}&space;u}}{\sqrt{t}}\frac{\mathrm{d}t}{2{\color{Red}&space;u}}=\frac{1}{2}\int\frac{1}{\sqrt&space;t}\,\mathrm{d}t=\frac{1}{2}\int&space;t^{\frac{1}{2}}\,\mathrm{d}t$

1/2 is a constant and is moved in front of the integral; at this point we can apply the power rule for integrals:

$\frac{1}{2}\frac{t^{-\frac{1}{2}+1}}{-\frac{1}{2}+1}=\frac{1}{2}\frac{t^{\frac{1}{2}}}{\frac{1}{2}}=t^\frac{1}{2}=\sqrt&space;t$

We are almost done; let’s undo all substitutions. Remember:

$\left&space;\{&space;u=\sec(x),\,t=u^2-1&space;\right&space;\}\rightarrow&space;t=\sec^2(x)-1;&space;\sqrt&space;t\xrightarrow[]{t=\sec^2(x)-1}\sqrt{\sec^2(x)-1}$

That’s the “final” result; “final” because we can actually do more: sec²(x)-1 comes from the trigonometric identity sec²(x)-tan²(x)=1 and, as you can see, it is equal to tan²(x); this means that

$\sqrt{\sec^2(x)-1}=\sqrt{\tan^2(x)}=\tan(x)$

Finally,

$\int&space;\sec^2(x)\,\mathrm{d}x=\tan(x)+C$

That’it! We’ve integrated the function sec²(x) with two methods. If you weren’t able to do it by yourself, keep in mind that looking at the procedures is actually a great way to learn the mechanism and all of the techniques; this is how I started, so stay positive!

I really hope you found this post helpful and if you enjoyed it leave a like and subscribe for more! In the next post we’ll find the integral of csc²(x), so in the mean time, give it a try!

Rating: 5 out of 5.

Join 31 other followers

## Posts you may find useful

### Integration techniques | U substitution

Ok, we now have the basis of integration! As I said in the previous post, I am now going to cover the techniques of integration. I will make a post for each method, because it’s important that you understand each of them before you can move on. In this lesson I teach you how to…

### Integration techniques | U substitution – part 2

U-substitution is the most common technique used in integration. It can happen, however, that it doesn’t work out, no matter what you try to substitute. You may think of using another technique, like integration by parts, but it’s not always necessary. You realise u-sub is not working when you still see one or more x’s.…

### Integration techniques | Integration by parts

U-substitution is a very useful technique for integration. You can apply it in every case, but it doesn’t always make things easier. But here comes this new technique in help! Integration by parts is used to calculate the integral of products. Well, everything is actually a product, (x² for example is x*x but also x²*1)…

### Rules and properties of integrals

Ok, this is the second step! I will cover the rules you need to apply to calculate an integral. With the next lesson, you will hopefully be able to start integrating! Let’s start! But first, I recommend you check out my post “What’s integration?” https://atomic-temporary-167386734.wpcomstaging.com/2019/09/28/whats-integration/ Linearity The sum or difference of two (or more) functions…

### The rules of differentiation

In the previous lesson we talked about differentiation in general; just as a reminder, it is a word that means “computation of a derivative”, the same way multiplication means “computation of a product” . Calculating the derivative of a function is quite easy if you know the rules of differentiation, which I will explain in…

This site uses Akismet to reduce spam. Learn how your comment data is processed.