# Integral of ln

1. Jul 2, 2012

### e^(i Pi)+1=0

1. The problem statement, all variables and given/known data
$f(x)=\int\frac{x+1}{x^2+2x}$

3. The attempt at a solution

I know that this can be solved with substitution. I'm wondering why I get the wrong answer when using this other method...

$f(x)=\int\frac{x+1}{x^2+2x}$

$=\int\frac{x}{x^2+2x}+\frac{1}{x^2+2x}$

$=\int\frac{1}{x+2}+\int\frac{1}{x^2+2}$

$=ln(x+2)+ln(x^2+2) + c$

I could simplify more, but it's wrong. It should be $.5(x^2+2) + c$

I'm guessing that $\int\frac{1}{x^2+2}\neq ln(x^2+2)$ so in what cases does $\int \frac{1}{x} = ln(x) + c$ not hold?? I just learned this stuff today so any answers will have to be rather explicit please.

2. Jul 2, 2012

### Harrisonized

This.

d/dx ln(x2+2) = 2x/(x2+2), which is obviously not equal to 1/(x2+2). Never forget the chain rule.

To integrate 1/(x2+2), you need to use trigonometric substitution.

Last edited by a moderator: Jul 2, 2012
3. Jul 2, 2012

### e^(i Pi)+1=0

Don't know that yet. So I guess that any time there's a nested function then ∫(1/x) dx=ln(x)+c doesn't hold?

Last edited by a moderator: Jul 2, 2012
4. Jul 2, 2012

### Harrisonized

Do you know of the chain rule?

Last edited by a moderator: Jul 2, 2012
5. Jul 2, 2012

### SammyS

Staff Emeritus
Of course $\displaystyle \int \frac{1}{x}\,dx=\ln|x|+C$ always holds.

What doesn't hold in general is $\displaystyle \int \frac{1}{f(x)}\,dx=\ln|f(x)|+C$

Last edited by a moderator: Jul 2, 2012
6. Jul 2, 2012

### e^(i Pi)+1=0

Yes, I meant I don't know trig substitution.

Last edited by a moderator: Jul 2, 2012
7. Jul 2, 2012

### e^(i Pi)+1=0

Could you provide a few examples please?

Last edited by a moderator: Jul 2, 2012
8. Jul 2, 2012

### Staff: Mentor

You did this problem the hard way, by splitting in into two integrals. An easy substitution will do the trick.

Let u = x2 + 2x, so du = (2x + 2)dx
Notice any similarity to the numerator of your original integral?

Last edited: Jul 2, 2012
9. Jul 2, 2012

### Dick

It's not a trig substitution. It's a u substitution. Try putting u=x^2+2x. What is du?

10. Jul 2, 2012

### e^(i Pi)+1=0

To the above two posts -

I know it's not trig substitution, I only mentioned I don't know that because it was mentioned by someone else. U-sub is easy, but I was trying to solve it this way because I'm trying to get a handle on derivatives and integrals of ln(x)

11. Jul 2, 2012

### Dick

If you don't want to do it the easy way using U-sub, then you'll need to do partial fractions on the second integral. Do you know that?

12. Jul 2, 2012

### Bohrok

Or complete the square and use a trig substitution?

13. Jul 2, 2012

### Dick

If doing it the hard way isn't enough and you want to do it the REALLY hard way, that should work.

14. Jul 3, 2012

### SammyS

Staff Emeritus
For instance, if f(x) = x2, then

$\displaystyle \int \frac{1}{f(x)}\,dx=\int\frac{1}{x^2}\,dx=\int x^{-2}\,dx=-x^{-1}+C\ne\ln(x^2)+C$

15. Jul 3, 2012

### Mentallic

$$\int\frac{1}{x}dx=\ln|x|+c$$ only holds because $$\frac{d}{dx}\left(\ln|x|+c\right)$$$$=\frac{1}{x}\cdot \frac{d}{dx}(x)=\frac{1}{x}$$ by use of the chain rule, while, in general, $$\frac{d}{dx}\left(\ln|f(x)|+c\right)$$$$=\frac{1}{f(x)}\cdot\frac{d}{dx}f(x)=\frac{f'(x)}{f(x)}$$

So if you have some f(x) in the denominator that needs integrating, unless the numerator is the derivative of the denomintor (or at least a constant multiplied by the derivative) then you can't take the log.