How can I integrate this: $$\int_{-1}^{1}\frac{\cos x}{e^\frac{1}{x}+1}dx$$
Using this hint $f(x)=\frac{f(x)+f(-x)}{2}+ \frac{f(x)-f(-x)}{2}$
How can I integrate this: $$\int_{-1}^{1}\frac{\cos x}{e^\frac{1}{x}+1}dx$$
Using this hint $f(x)=\frac{f(x)+f(-x)}{2}+ \frac{f(x)-f(-x)}{2}$
On
If $f(x) = \frac{\cos x}{e^{\frac{1}{x}} + 1}$, then $$f(-x) = \frac{\cos x}{e^{-\frac{1}{x}} + 1}=\frac{e^{\frac{1}{x}}\cos x}{1+e^{\frac{1}{x}}}.$$ So, $f(x) + f(-x) = \cos x$. Using the hint, we get
$$f(x)=\frac{f(x)+f(-x)}{2}+ \frac{f(x)-f(-x)}{2}=\frac{\cos x}{2}+ \frac{f(x)-f(-x)}{2}.$$ The first term is something nice, and the second term is an odd function. Can you see how to compute the integral from here?
On
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
With the identity: $\ds{\mrm{f}\pars{z} \equiv{1 \over \expo{z} + 1} = \left\{\begin{array}{lcl} \ds{\mrm{H}\pars{-z} + \mrm{sgn}\pars{z}\,\mrm{f}\pars{\verts{z}}} & \mbox{if} & \ds{z \not= 0} \\[2mm] \ds{1 \over 2} & \mbox{if} & \ds{z = 0} \end{array}\right.}\,\,\,\,\,\,\,\,\,\,\,,$
where $\ds{\mrm{H}}$ is the Heaviside Step Function,
\begin{align} \int_{-1}^{1}{\cos\pars{x} \over \expo{1/x} + 1}\,\dd x = \overbrace{\int_{-1}^{0}\cos\pars{x}\,\dd x} ^{\ds{\sin\pars{0} - \sin\pars{-1}}}\ +\ \overbrace{\int_{-1}^{1}{\cos\pars{x}\,\mrm{sgn}\pars{x} \over \expo{1/\verts{x}} + 1}\,\dd x}^{\ds{=\ 0}}\ =\ \bbx{\sin\pars{1}} \approx 0.8415 \end{align}
Let $$ I=\int_{-1}^{1}\frac{\cos x}{e^{\frac{1}{x}}+1}dx. \tag{1}$$ Under $x\to-x$, one has $$I=\int_{-1}^{1}\frac{\cos x}{e^{-\frac{1}{x}}+1}dx=\int_{-1}^{1}\frac{e^{\frac{1}{x}}\cos x}{e^{\frac{1}{x}}+1}dx.\tag{2}$$ Now adding (1) to (2), one has $$ 2I=\int_{-1}^1\cos xdx $$ which is easy to handle.