# Thread: Integration of tan(x) * sec^2(x) dx

1. ## Integration of tan(x) * sec^2(x) dx

Hi,

I'm having real trouble with the following integration. I've tried it by parts but that's not going well for me.

$
\int{ \tan{}x\sec{}^2x } dx
$

The given answer I have is $\frac{\sec{}^2x}{2} + C$ but I unfortunately can't seem to arrive at it (or any other answer.)

Can anyone help? Thanks!

2. This one is actually very easy.

Let $u=sec(x), \;\ du=sec(x)tan(x)dx$

$\int u du$

3. Let $u=\tan{x}$; then $du=\sec^2{x}\,dx$.

4. Ah-ah! I knew I was missing something! Thanks.

However, there's something I'm unclear about here. Using galactus's suggestion of letting $u = \sec{}x$, we get $du = \sec{}x\tan{}x dx$, and so

$
\int{\tan{}x\sec{}^2x dx} = \int{u du}
= \frac{u^2}{2}
= \frac{\sec{}^2x}{2} + C
$

That's fine, until I attempt JaneBennet's alternative suggestion: let $u = \tan{}x$, so $du = \sec{}^2x dx$, and so

$
\int{\tan{}x\sec{}^2x dx} = \int{u du}
= \frac{u^2}{2}
= \frac{\tan{}^2x}{2} + C
$

But I think $\frac{\sec{}^2x}{2}$ and $\frac{\tan{}^2x}{2}$ aren't equivalent, are they? What have I done wrong there? (Or is it that both are correct but the constants would have different values?)

5. Hello
But I think $\frac{\sec{}^2x}{2}$ and $\frac{\tan{}^2x}{2}$ aren't equivalent, are they? What have I done wrong there?
Nothing is wrong in your work except that you forgot to add a constant to each anti-derivative. Using $\tan^2x+1=\sec^2x$, one can show that the two answers you've found are in fact similar :

$
\int{\tan{}x\sec{}^2x \,\mathrm{d}x}= \frac{\tan{}^2x}{2}+C=\frac{\sec^2x}{2}-\underbrace{\frac12+C}_{\text{constant}}=\frac{\se c^2x}{2}+C'
$

You left out the "plus C" . . .

There's something I'm unclear about here.
Using galactus' suggestion of letting $u = \sec x$, we get $du = \sec x\tan x\,dx$

. . and so: . $\int \tan x\sec^2\!x\,dx \:= \:\int u\,du \:=\:\frac{u^2}{2}\:=\:\frac{1}{2}\sec^2\!x$

That's fine, until I attempt JaneBennet's alternative suggestion:
let $u = \tan x$, so $du = \sec^2\!x\,dx$,

. . and so: . $\int \tan x\sec^2\!x\,dx \:=\: \int u\,du \:= \:\frac{1}{2}u^2\:=\:\frac{1}{2}\tan^2\!x$

But I think $\frac{1}{2}\sec^2\!x$ and $\frac{1}{2}\tan^2\!x$ aren't equivalent, are they? . . . . Yes, they are

What have I done wrong there?

Recall the Identity: . $\sec^2\!\theta \:=\:\tan^2\!\theta + 1$

You should have had: . $\begin{array}{c}\frac{1}{2}\sec^2\!x \:{\color{blue}+ C_1} \\ \\[-3mm] \frac{1}{2}\tan^2\!x \:{\color{blue}+ C_2} \end{array}$

If these are equivalent: . $\frac{1}{2}\sec^2\!x + C_1 \;=\;\frac{1}{2}\tan^2\!x + C_2$

Multiply by 2: . $\sec^2\!x + 2C_1 \:=\:\tan^2\!x + 2C_2 \quad\Rightarrow\quad \sec^2\!x \:=\:\tan^2\!x + 2C_2-2C_1$

$\text{We have: }\;\sec^2\!x \;=\;\tan^2\!x + \underbrace{2(C_2-C_1)}_{\text{a constant}}$

If that constant is 1, we have the Identity.
. .The expressions are equivalent!

Edit: flyingsquirrel beat me to me . . . *sigh*
.

7. Thanks all!

I realized I had made that classic schoolboy error and added the constants in an edit before you could both hit Submit

Thanks to everyone's kind help, it makes sense and all is right with the world again.

Thanks again.