Integration by parts tanx help

1. May 1, 2008

carbz

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

1. The problem statement, all variables and given/known data
$$\int\frac{x}{x^{2}+4x+4}dx$$

2. Relevant equations
None

3. 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:
1. The problem statement, all variables and given/known data
$$/int$$ $$(tan^{2}(x))dx$$

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

3. 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: May 1, 2008
2. May 1, 2008

drdizzard

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

3. May 1, 2008

carbz

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.

4. May 1, 2008

jambaugh

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!!!

5. May 1, 2008

flebbyman

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

6. May 1, 2008

carbz

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?

7. May 1, 2008

jambaugh

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.]

8. May 1, 2008

carbz

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?

9. May 1, 2008

jambaugh

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

10. May 1, 2008

tiny-tim

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$$

11. May 1, 2008

jambaugh

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.

12. May 1, 2008

rootX

his thing = (x+2)/(x+2)^2 - 2/(x+2)^2
so, no *twice* substitution

Last edited: May 1, 2008
13. May 1, 2008

tiny-tim

No … jambaugh is right … you and I can do it in our heads, but without that knack it does require a substitution!

14. May 1, 2008

tron_2.0

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.

15. May 1, 2008

tiny-tim

Hi tron_2.0!

Yes … and B will be 0 …

… but that's exactly what we have done!

16. May 1, 2008

tron_2.0

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

17. May 1, 2008

flebbyman

Nice one carbz

18. May 1, 2008

jambaugh

OK I take back the "twice", as it is the same substitution and you can write the two summed integrals as a single one.

In effect it is the same two steps in different orders as when I say "you can then separate into powers of u and integrate" this is a trivial case of expansion into partial fractions. Ultimately the preference is one of which you can do more easily the first substitution or the first expansion by partial fractions.

19. May 1, 2008

carbz

well, the C is always annoying, but thank you.