# Ln(cosx+1) integral

Whats the integral of ln(cosx+1)? By the way don't give me the answer, give me the basic idea, i want to find the solution myself(i love integrals ). I tried to multiply by x'(=1) and then integrate by parts but the integral became even more complicated. I really need to calculate this one so i can calculate another integral. Also are there any general methods to calculate any ln(P(x))?

Mark44
Mentor
I can't think of any way other than integration by parts, but you are very limited in the choice of u and dv. For this problem u = ln(cos(x) + 1) and dv = dx, so du = 1/(cos x + 1) * (-sin x), and v = x. You might or might not be able to do something with this.

What did you mean when you said "I tried to multiply by x'(=1)"?

I can't think of any way other than integration by parts, but you are very limited in the choice of u and dv. For this problem u = ln(cos(x) + 1) and dv = dx, so du = 1/(cos x + 1) * (-sin x), and v = x. You might or might not be able to do something with this.

What did you mean when you said "I tried to multiply by x'(=1)"?
i am not sure what you mean either. Are you suggesting integration by u substitution? If so u=ln(cosx+1) du=-sinx/(cosx+1)dx and since i don't have the -sinx/cosx+1 i can't "create" the du. I multiplied by x' in order to integrate by parts. That way you also find the integral of lnx

Mark44
Mentor
No, I didn't say or mean integration by substitution. What I said was that I couldn't think of any approach other than integration by parts, and I gave what I think is the only feasible separation. Ordinary substitution clearly won't work here.

Mark44
Mentor
What did you mean when you said "I tried to multiply by x'(=1)"?

$$2 i \text{Li}_2\left(-e^{i x}\right)+\frac{i x^2}{2}-2 x \log \left(1+e^{i x}\right)+x \log (\cos (x)+1)$$

yea there's no way you're figuring that out from just integration by parts

$$2 i \text{Li}_2\left(-e^{i x}\right)+\frac{i x^2}{2}-2 x \log \left(1+e^{i x}\right)+x \log (\cos (x)+1)$$

yea there's no way you're figuring that out from just integration by parts
any mathematician can explain how to get to that conclusion?

Char. Limit
Gold Member
any mathematician can explain how to get to that conclusion?

Considering that e^(ix) appears as a term, I would assume that one of the steps involves splitting the cosine into two exponential functions using the identity...

$$cos(z) = \frac{e^{iz}+e^{-iz}}{2}$$

And I'm looking at the Dilogarithm now... I've never seen it before, so I don't know how it would arrive.

Considering that e^(ix) appears as a term, I would assume that one of the steps involves splitting the cosine into two exponential functions using the identity...

$$cos(z) = \frac{e^{iz}+e^{-iz}}{2}$$

And I'm looking at the Dilogarithm now... I've never seen it before, so I don't know how it would arrive.
Complex number!!! Great. From real to imaginary... Anyway, I am really interested in this particular integral because i need it to integrate another function. This one x/sinx
Take a look at the attached file to see why i need the integral of ln(cosx+1)

#### Attachments

• 16.5 KB Views: 291
Last edited:
What exactly is the context of this? These kind of things tend to pop out in math competitions, though they are usually definite integrals and it turns out there's some trick you can pull off with the bounds on the integral, given the right bounds.

Char. Limit
Gold Member
Complex number!!! Great. From real to imaginary... Anyway, I am really interested in this particular integral because i need it to integrate another function. This one x/sinx
Take a look at the attached file to see why i need the integral of ln(cosx+1)
Hmm... yes, you will have imaginary numbers, considering that the integral of ln(cos(x)+1), given earlier, can be written...

$$x\left(ln\left(cos\left(x\right)+1\right)+ln\left(1+e^{ix}\right)\right) + i \left(2 Li_2\left(-e^{ix}\right) + \frac{i x^2}{2}\right)$$

Hmm... I'm not saying this will help at all, but if you combined the logarithms in the left side, it might at least make the equation a bit simpler. Or maybe it will make the equation not understandable at all.

What you did makes no sense on the last line. You found the integral of 1/sin x. However,

$$\int \frac{x}{sin x} dx \neq \int x (\int \frac{1}{sin x}) dx$$

Which is what you are implying.

EDIT: Oops, didn't see the prime.

What you did makes no sense on the last line. You found the integral of 1/sin x. However,

$$\int \frac{x}{sin x} dx \neq \int x (\int \frac{1}{sin x}) dx$$

Which is what you are implying.

EDIT: Oops, didn't see the prime.
I am not implying this.

EDIT: Oops, didn't see you edited your post

Anyway(I have a feeling that i am using this word too many times recently), are my calculations correct ? Is there any shorter path to the solution?

Last edited:
What exactly is the context of this? These kind of things tend to pop out in math competitions, though they are usually definite integrals and it turns out there's some trick you can pull off with the bounds on the integral, given the right bounds.
The context? My brain.
One day i woke up and i said "Its time to integrate! Lets start with an easy one.... maybe this one: ln(cosx+1)! Its going to take half a second....(after half an hour)...Its impossible to integrate this!!!! Oh wait, the polite members of the physics forums could help a little..." And here we are, Guillaume de l'Hospital

any mathematician can explain how to get to that conclusion?
I think I can but I'm not a Mathematician: it takes a bunch of integration by parts. But first write it as:

$\int \log(1+\cos(x))dx=\frac{i x^2}{2}-2 x \text{log}\left[1+e^{i x}\right]+x \text{log}[1+\text{cos}[x]]+2 i \text{PolyLog}\left[2,-e^{i x}\right]$

and recall:

$\text{Polylog}[n,z]=\sum_{k=1}^{\infty}\frac{z^k}{k^n}$

Now consider the last integration by parts (I'm jumping to the end):

$\int \log(1+e^{ix})dx$

can you evaluate that integral in terms of that Polylog sum? So that gives the Polylog term. Now start from the beginning:

$\int \log(1+\cos(x))dx$

You can do that one via parts and get a term:

$\int\frac{x\sin(x)}{1+\cos(x)}dx$

Now express the sin and cos in terms of their complex exponential forms and then start doing more integration by parts.

Last edited:
I think I can but I'm not a Mathematician: it takes a bunch of integration by parts. But first write it as:

$\int \log(1+\cos(x))dx=\frac{i x^2}{2}-2 x \text{log}\left[1+e^{i x}\right]+x \text{log}[1+\text{cos}[x]]+2 i \text{PolyLog}\left[2,-e^{i x}\right]$

and recall:

$\text{Polylog}[n,z]=\sum_{k=1}^{\infty}\frac{z^k}{k^n}$

Now consider the last integration by parts (I'm jumping to the end):

$\int \log(1+e^{ix})dx$

can you evaluate that integral in terms of that Polylog sum? So that gives the Polylog term. Now start from the beginning:

$\int \log(1+\cos(x))dx$

You can do that one via parts and get a term:

$\int\frac{x\sin(x)}{1+\cos(x)}dx$

Now express the sin and cos in terms of their complex exponential forms and then start doing more integration by parts.
How did you get from $\int \log(1+\cos(x))dx$
to
$\frac{i x^2}{2}-2 x \text{log}\left[1+e^{i x}\right]+x \text{log}[1+\text{cos}[x]]+2 i \text{PolyLog}\left[2,-e^{i x}\right]$
?
Is this a property or something? Also, isn't the Reimann sum used in definite integrals?

Ok, I have done some progress, even though i am afraid that i have abused the mathematical laws due to my limited knowledge of complex numbers. If i am correct, all i need is the integral
of ln(e^(ix)-1)

#### Attachments

• 17.5 KB Views: 213
Last edited:
How did you get from $\int \log(1+\cos(x))dx$
to
$\frac{i x^2}{2}-2 x \text{log}\left[1+e^{i x}\right]+x \text{log}[1+\text{cos}[x]]+2 i \text{PolyLog}\left[2,-e^{i x}\right]$
?
Is this a property or something? Also, isn't the Reimann sum used in definite integrals?

$$\int\log(1+\cos(x))dx$$

Let $u=\log(1+\cos(x))$ and $dv=dx$

then I get via parts:

$$x\log(1+cos(x))+\int \frac{x\sin(x)}{1+\cos(x)}dx$$

Now:

$$\int \frac{x\sin(x)}{1+\cos(x)}=\int\frac{x\left(\frac{e^{ix}-e^{-ix}}{2i}\right)}{1+\frac{e^{ix}+e^{-ix}}{2}}dx$$

Now simplify that exp expression and then approach the integral strictly in terms of the exponentials. Will have to do a few more integrations by parts. Also, I didn't look at the doc file in the other post.

Last edited:

$$\int\log(1+\cos(x))dx$$

Let $u=\log(1+\cos(x))$ and $du=dx$

then I get via parts:

$$x\log(1+cos(x))+\int \frac{x\sin(x)}{1+\cos(x)}dx$$

Now:

$$\int \frac{x\sin(x)}{1+\cos(x)}=\int\frac{x\left(\frac{e^{ix}-e^{-ix}}{2i}\right)}{1+\frac{e^{ix}+e^{-ix}}{2}}dx$$

Now simplify that exp expression and then approach the integral strictly in terms of the exponentials. Will have to do a few more integrations by parts. Also, I didn't look at the doc file in the other post.
Now i understand what you meant but its gonna take a lot of integration by parts

I did it !!!!! I have propably made some errors in some operations(i think thats how you call addition, substraction etc.) and in the sings(i think thats how you also call the "+" and "-") but the whole idea is correct. What i found really interesting is that it took me 2 lines to find integral of 1/sinx while it took me 24 lines(1 page and a half) to find the integral of x/sinx
Also the integral of x/sinx is two times longer than the integral of 1/sinx and the first includes complex numbers while the second doesn't. Enough said, click on the attached file
PS: The Wolfram mathematica answer is very different

#### Attachments

• 31 KB Views: 275
On the first line, you wrote

$$\int \frac{\ln x}{x+1} = \int (\frac{1}{x})' \frac{1}{x+1}$$

This implies that ln x = (1/x)'.

But (1/x)' = -1/x^2

Unless I went blind again.

On the first line, you wrote

$$\int \frac{\ln x}{x+1} = \int (\frac{1}{x})' \frac{1}{x+1}$$

This implies that ln x = (1/x)'.

But (1/x)' = -1/x^2

Unless I went blind again.
Oh no no no no!!!!!! You are right!!!! (1/x)' is not lnx God the whole solution is wrong even from the first line!!!! I was tired the night i was writing that and i got confused

Oh no no no no!!!!!! You are right!!!! (1/x)' is not lnx God the whole solution is wrong even from the first line!!!! I was tired the night i was writing that and i got confused
Let me suggest a 21st cenury approach: Do each step and then verify it in Mathematica before going to the next step and in this way Mathematica "channels" you towards the correct (final)answer.

hey one method i think is that first put cosx=t(t is some variable). then use log(1+t) series and expand. again after expanding put t=cosx. now if possible integrate or again use the series of cosx in terms of x. u may get the ans.

Whats the integral of ln(cosx+1)? By the way don't give me the answer, give me the basic idea, i want to find the solution myself(i love integrals ). I tried to multiply by x'(=1) and then integrate by parts but the integral became even more complicated. I really need to calculate this one so i can calculate another integral. Also are there any general methods to calculate any ln(P(x))?
Hi there I have solved this integral and found the exact answer applying integral by parts and trigonometric formulas only