# Extremely confusing integral

## Homework Statement

Find the integral of

$\int\frac{cos(x)}{1+e^{x}}$

## Homework Equations

Given that

$\frac{1}{1+e^{x}}$-$\frac{1}{2}$ is an odd function

## The Attempt at a Solution

I tried integration by parts, with both u = cos(x) and u = 1+e^x, and both only complicated it even more. I've not learned infinite series and sequences so I'm not sure thats the way.

I did try writing cos(x) as $\frac{e^{ix}+e^{-ix}}{2}$, but I'm not sure what to do after that. I can see that there'd be some hyperbolic stuff in here but again, I'm not sure where exactly to start.

Related Calculus and Beyond Homework Help News on Phys.org
LCKurtz
Homework Helper
Gold Member

## Homework Statement

Find the integral of

$\int\frac{cos(x)}{1+e^{x}}$

## Homework Equations

Given that

$\frac{1}{1+e^{x}}$-$\frac{1}{2}$ is an odd function
I don't see how that is relevant unless you are doing a definite integral on an interval like [-a,a].

## The Attempt at a Solution

I tried integration by parts, with both u = cos(x) and u = 1+e^x, and both only complicated it even more. I've not learned infinite series and sequences so I'm not sure thats the way.

I did try writing cos(x) as $\frac{e^{ix}+e^{-ix}}{2}$, but I'm not sure what to do after that. I can see that there'd be some hyperbolic stuff in here but again, I'm not sure where exactly to start.
I don't think there is an elementary antiderivative.

I don't see how that is relevant unless you are doing a definite integral on an interval like [-a,a].

I don't think there is an elementary antiderivative.
Oh jeez I forgot to put the interval. its from -pi/2 to pi/2. I'm really sorry about that

LCKurtz
Homework Helper
Gold Member
Oh jeez I forgot to put the interval. its from -pi/2 to pi/2. I'm really sorry about that
If ##f(x)## is odd what do you know about ##\int_{-a}^a f(x)\, dx##?

SammyS
Staff Emeritus
Homework Helper
Gold Member
So, what is $\displaystyle \int_{-\pi/2}^{\pi/2}\left(\frac{1}{1+e^{x}}-\frac{1}{2}\right)\cos(x)\,dx\ ?$

If ##f(x)## is odd what do you know about ##\int_{-a}^a f(x)\, dx##?
It would equal 0. So as SammyS put it, it would be $\displaystyle \int_{-\pi/2}^{\pi/2}\left(\frac{1}{1+e^{x}}-\frac{1}{2}\right)\cos(x)\,dx\ ?$, where the first term would go to zero and then I'm left to evaluate the last bit which would be -$\int_{-\pi/2}^{\pi/2}\frac{cos(x)}{2}$?

So, what is $\displaystyle \int_{-\pi/2}^{\pi/2}\left(\frac{1}{1+e^{x}}-\frac{1}{2}\right)\cos(x)\,dx$
Is this just the integral of the right side then? So it's just -1?

LCKurtz
Homework Helper
Gold Member
It would equal 0. So as SammyS put it, it would be $\displaystyle \int_{-\pi/2}^{\pi/2}\left(\frac{1}{1+e^{x}}-\frac{1}{2}\right)\cos(x)\,dx\ ?$, where the first term would go to zero and then I'm left to evaluate the last bit which would be -$\int_{-\pi/2}^{\pi/2}\frac{cos(x)}{2}$?
No. You don't evaluate an integral in pieces like that. You have ##\frac{1}{1+e^{x}}-\frac{1}{2}## multiplied by ##\cos x##. Is ##\cos x ## even, odd, or neither? What about its product with ##\frac{1}{1+e^{x}}-\frac{1}{2}##?

SammyS
Staff Emeritus
It would equal 0. So as SammyS put it, it would be $\displaystyle \int_{-\pi/2}^{\pi/2}\left(\frac{1}{1+e^{x}}-\frac{1}{2}\right)\cos(x)\,dx\ ?$, where the first term would go to zero and then I'm left to evaluate the last bit which would be -$\int_{-\pi/2}^{\pi/2}\frac{cos(x)}{2}$?
Remember, the hint says that $\displaystyle \frac{1}{1+e^{x}}-\frac{1}{2}\$ is odd (that entire expression).
How do you get $\displaystyle \frac{1}{1+e^{x}}-\frac{1}{2}\$ from $\displaystyle \frac{1}{1+e^{x}}\ ?$