# Integration by parts tanx help

I actually have two here, so I will just list both:

## Homework Statement

$$\int\frac{x}{x^{2}+4x+4}dx$$

None

## The Attempt at a Solution

I tried this one twice. I honestly have no idea how to do it, and I used integration by parts. The first time, I reduced it down to:
$$\int\frac{1}{x} + \frac{1}{4} + \frac{x}{4}dx$$
But, this is wrong.

I tried it a second time by using integration by parts to obtain:
$$\int\frac{x}{(x+2)(x+2)}dx$$, then I reduced that down, since integration by parts does not work. So, I was hoping to know what I am susposed to do.

The second one is a bit different:

## Homework Statement

$$/int$$ $$(tan^{2}(x))dx$$

## Homework Equations

$$tan^{2}(x) + 1 = sec^{2}$$

## The Attempt at a Solution

I used the regular formula that I listed to get:
$$\int(sec^{2}(x) - 1)dx$$.
I just integrated to: $$tan^{2} - x + c$$
I wanted to see if this one is correct.

Last edited:

For the first problem you need to use integration by partial fractions to solve it.

You were on the right track in the second problem changing (tanx)^2 to (secx)^2 - 1 now you just have to integrate each seperatly which you did right except for the integral of (secx)^2 is just tanx

I did use that too for the first one, and I could not find an answer. When I did it, I got 2=0 which is not an answer.

All right, thank you for the second one.

jambaugh
Gold Member
Quicker solution to the first problem:

Use variable substitution: $$u = x+2$$
You'll then get:
$$\int \frac{something}{u^2}du$$
which you can then separate into powers of u and integrate.

Your integration in the second problem is not quite correct.
Recall that $$\frac{d}{dx} \tan (x) = \sec^2(x)$$ not tan squared!!!

You got $$\int\frac{x}{(x+2)^2}dx$$

use the substitution u=x+2, so x=u-2 and dx=du and take it from there

What both of you are saying will produce:
$$\int\frac{x}{u^{2}}$$
Shouldn't the x in the numerator be apart of it too?

jambaugh
Gold Member
What both of you are saying will produce:
$$\int\frac{x}{u^{2}}$$
Shouldn't the x in the numerator be apart of it too?
You must finish the substitution.... rewrite x in terms of u.

[edit: And of course when you're done integrating, rewrite your answer back in terms of x.]

yes, you said that $$u = x+2$$
The derivative of that is $$du = 1dx$$

That would only get:
$$\int\frac{x}{u^{2}}$$

Then you would solve x equal to u-2?

That would get:

$$\int\frac{u-2}{u^{2}}$$

That would make:
$$\int\frac{1}{u} - \int\frac{2}{u^{2}}$$ = $$ln(x) - \frac{-2}{u}$$
Then, of course, you would put x+2 back in for all u's. Right?

jambaugh
Gold Member
Right! (But don't forget the +C!!!) ;-)

tiny-tim
Homework Helper
Hi carbz!

A partial fractions method (which avoids having to substitue and then substitute back again ) is:

$$\int\frac{x}{x^{2}+4x+4}dx$$

$$=\,\int\frac{x+2}{x^{2}+4x+4}dx \,-\,\int\frac{2}{x^{2}+4x+4}dx$$

jambaugh
Gold Member
Hi carbz!

A partial fractions method (which avoids having to substitue and then substitute back again ) is:

$$\int\frac{x}{x^{2}+4x+4}dx$$

$$=\,\int\frac{x+2}{x^{2}+4x+4}dx \,-\,\int\frac{2}{x^{2}+4x+4}dx$$
You've not solved it yet. You'll still need to do a substitution to integrate the partial fractions. Now you must do it twice. Also since its a linear substitution you can do it in your head once you're practiced.

You've not solved it yet. You'll still need to do a substitution to integrate the partial fractions. Now you must do it twice. Also since its a linear substitution you can do it in your head once you're practiced.
his thing = (x+2)/(x+2)^2 - 2/(x+2)^2
so, no *twice* substitution

Last edited:
tiny-tim
Homework Helper
… so, no *twice* substitution
No … jambaugh is right … you and I can do it in our heads, but without that knack it does require a substitution!

actually couldnt you do it with partial fractions and integrating once?

you can break up x/(x^2+4x+4) into x/(x+2)^2

therefore by partial fractions you could break it into [x/(x+2)^2]= A/(x+2) + Bx+C/[(x+2)^2]

from there you can solve for A, B, and C and plug that back into your original integral

not sure if thats what you originally ment but idk.

tiny-tim
Homework Helper
… therefore by partial fractions you could break it into [x/(x+2)^2]= A/(x+2) + Bx+C/[(x+2)^2] …
Hi tron_2.0!

Yes … and B will be 0 …

… but that's exactly what we have done!

ahh my mistake, i should have read the replies more closely =[

Nice one carbz

jambaugh