# Integral of secant

## Homework Statement

Basically, I have to find

$$\int \frac{1}{cosx} dx$$

by multiplying the integrand by $$\frac{cosx}{cosx}$$

I go through and arrive at a solution, but when I differentiate it,
I get -tan(x)

something's clearly wrong, but I can't see what it is that I'm doing wrong here...

## Homework Equations

$$let u = sin(x)$$

$$du = cos(x)dx$$

## The Attempt at a Solution

$$\int \frac{1}{cosx} dx = \int \frac{cosx}{cos^2x} dx\\ = \int \frac{cosx}{1-sin^2x} dx\\ =\int \frac{du}{1-u^2} \\ =\int \frac{du}{(1-u)*(1+u)} \\ =\frac{1}{2} * \int \frac {1}{1+u} + \frac {1}{1-u} du\\ = \frac{1}{2} * (ln(1-u^2}}) =\frac{1}{2} * (ln(cos^2))$$

Last edited:

Related Calculus and Beyond Homework Help News on Phys.org
StatusX
Homework Helper
Your second to last step (where you actually perform the integration) is wrong. In the second term, remember that u has a minus sign.

hmm..

I've never run into anything like this before

so why does u having a minus sign in front of it pose a problem with what I did in my original solution?

(thanks for the help)

cristo
Staff Emeritus
Well, the value of your integral will be ln(1+u)-ln(1-u)

if I kept the minus sign where it was, which is what I did in my original solution, my integral would've been
$$ln(1+u)+ln(1-u)=ln(1-u^2)$$

StatusX told me to watch out for the negative sign in front of the u, so I factored it out, made sure that u was positive, and then integrated it, which gave me the correct solution.

the thing is i'm not sure why I couldn't proceed as usual with the minus sign in front of the u

cristo
Staff Emeritus
StatusX said to note the minus sign in front of the u. You can proceed as normal, but noting that $$\int\frac{1}{1-u}du=-ln(1-u)$$. In general $$\int\frac{1}{f(u)}du=\frac{ln[f(u)]}{df/du}$$. In this case, f(u)=1-u, and so df/du=-1

ah, ok

thank you!

i didn't know we would utilizie such a method to do this integral.

i've always thought the integral of secant was just sec[x]tan[x]!

cristo
Staff Emeritus