# How to integrate ln(x^2+4)?

**URL:** https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060
**Category:** Factual Questions
**Created:** [March 17, 2005, 10:27pm UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060 "2005-03-17T22:27:24Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Muad\_Dib](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Muad\_Dib](https://boards.straightdope.com/u/Muad_Dib)
#### Post date: [March 17, 2005, 10:27pm UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/1 "2005-03-17T22:27:24Z")

</div>

Ive gotten it half done by using parts to :

xln(x^2+4)-2\*int((x^2)/(x^2+4))

The problem would be a cinch if it were not for that pesky extra x in the numerator. I also know that the answer involves an arctan but I do not know what to do next.

---

<div class="post-metadata">

### Author: ![QuizCustodet](https://avatars.discourse-cdn.com/v4/letter/q/7ba0ec/32.png) [@QuizCustodet](https://boards.straightdope.com/u/QuizCustodet)
#### Post date: [March 17, 2005, 10:38pm UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/2 "2005-03-17T22:38:35Z")

</div>

Given that you know the answer involves an arc-tan, I’d suggest substituting x = 2 cos theta. (Not guaranteed to work, as it’s late at night, but it looks good for simplification of that squared term.) Trig substitutions have the additional virtue that one can often integrate by parts twice to end up with a do-able integral minus the original integral again.

---

<div class="post-metadata">

### Author: ![ZebraShaSha](https://avatars.discourse-cdn.com/v4/letter/z/eada6e/32.png) [@ZebraShaSha](https://boards.straightdope.com/u/ZebraShaSha)
#### Post date: [March 17, 2005, 10:39pm UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/3 "2005-03-17T22:39:23Z")

</div>

Do you want to know how to do it or the answer? The answer, if it is the integral of ln(x^2+4), is xln(x^2+4)+2(2Arctan(x/2)-x). I’ll show the work, if I can, on request.

---

<div class="post-metadata">

### Author: ![Muad\_Dib](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Muad\_Dib](https://boards.straightdope.com/u/Muad_Dib)
#### Post date: [March 17, 2005, 10:48pm UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/4 "2005-03-17T22:48:17Z")

</div>

> [@ZebraShaSha](#):
>
> Do you want to know how to do it or the answer? The answer, if it is the integral of ln(x^2+4), is xln(x^2+4)+2(2Arctan(x/2)-x). I’ll show the work, if I can, on request.

Please, iwould greatly appreciate it.

---

<div class="post-metadata">

### Author: ![ZebraShaSha](https://avatars.discourse-cdn.com/v4/letter/z/eada6e/32.png) [@ZebraShaSha](https://boards.straightdope.com/u/ZebraShaSha)
#### Post date: [March 17, 2005, 11:01pm UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/5 "2005-03-17T23:01:33Z")

</div>

So you got it this far, xln(x^2+4)-2_int((x^2)/(x^2+4)), right? I’ll just concentrate on the last part for a minute, if you don’t mind.  
-2_int((x^2)/(x^2+4))  
(x^2)/(x^2+4)  
Now, to the denominator we had a -4 and a positive 4, so the net result will be zero. The reason why will become readily apparent in a minute.  
(x^2+4-4)/(x^2+4)  
Then, splitting it up, we have  
(x^2+4)/(x^2+4) - 4/(x^2+4)  
The first cancel out, making it  
1-4/(x^2+4)  
Substituting back in, we have  
-2\*int(1-4/(x^2+4))  
-2[int(1)-4int(1/(x^2+4))]  
Recognizing the Thrm int( 1/(a^2+u^2)=1/a Arctan (x/a) + C we have a=2 and u=x so,  
-2[x-2Arctan(x/2)] + C and finally xln(x^2+4)+2(2Arctan(x/2)-x).

Need some clarification at all? I suck at teaching, sorry.

---

<div class="post-metadata">

### Author: ![Worzo](https://avatars.discourse-cdn.com/v4/letter/w/c5a1d2/32.png) [@Worzo](https://boards.straightdope.com/u/Worzo)
#### Post date: [March 17, 2005, 11:19pm UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/6 "2005-03-17T23:19:12Z")

</div>

Just make the substitution x = 2tan(u) for the second integral. You get 4\*(1+tan^2(u)) = 4sec^2(u) on the bottom, and with dx = 2sec^2(u) du, it all cancels nicely and you can do it in about 2 lines!

Andy.

---

<div class="post-metadata">

### Author: ![ZebraShaSha](https://avatars.discourse-cdn.com/v4/letter/z/eada6e/32.png) [@ZebraShaSha](https://boards.straightdope.com/u/ZebraShaSha)
#### Post date: [March 18, 2005, 12:52am UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/7 "2005-03-18T00:52:32Z")

</div>

> [@Worzo](#):
>
> Just make the substitution x = 2tan(u) for the second integral. You get 4\*(1+tan^2(u)) = 4sec^2(u) on the bottom, and with dx = 2sec^2(u) du, it all cancels nicely and you can do it in about 2 lines!
> 
> Andy.

Ah, looks brilliant. But, I have a question right about here:

(pardon the sloppiness)

…tan^2(u)… 2tan(u) = x  
int------------- dx…,…2sec^2(u) = dx  
…sec^2(u)

But, you have 1/sec^2(u) and not sec^2(u). What am I missing here?

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [March 18, 2005, 12:58am UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/8 "2005-03-18T00:58:03Z")

</div>

1/sec(u)[sup]2[/sup] = cos(u)[sup]2[/sup].

---

<div class="post-metadata">

### Author: ![ZebraShaSha](https://avatars.discourse-cdn.com/v4/letter/z/eada6e/32.png) [@ZebraShaSha](https://boards.straightdope.com/u/ZebraShaSha)
#### Post date: [March 18, 2005, 1:06am UTC](https://boards.straightdope.com/t/how-to-integrate-ln-x-2-4/295060/9 "2005-03-18T01:06:34Z")

</div>

Perhaps I should clarify my confusion: How do you substitute in sec^2(u) if what you have in the integrand is really sec^-2(u) or, as noted, cos^2(u)?

Not doubting the method, just trying to have my ignorance fought.
