# Compute $\int \frac{\sin(x)}{\sin(x)+\cos(x)}\mathrm dx$

I've got troubles in computing the below integral: $$\int \frac{\sin(x)}{\sin(x)+\cos(x)}\mathrm dx$$ I hope it can be expressed in elementary functions. I've tried simple substitution as $u=\sin(x)$ and $u=\cos(x)$ but not so effective the results were.

Any suggestions are welcomed. Thanks.

-

1
I removed the display from your title. It's better to keep titles simple so that the main page does not break too much. – Mariano Suárez-Alvarez♦ Aug 9 '12 at 17:01
– clark Aug 9 '12 at 17:06

## 5 Answers

Let $I:=\int\frac{\cos x}{\cos x+\sin x}dx$ and $J:=\int\frac{\sin x}{\cos x+\sin x}dx$. Then $I+J=x+C$, and $$I-J=\int\frac{\cos x-\sin x}{\cos x+\sin x}dx=\int\frac{u'(x)}{u(x)}dx,$$ where $u(x)=\cos x+\sin x$. Now we can conclude.

-

1
This is almost too cute for its own good :-) – Mariano Suárez-Alvarez♦ Aug 9 '12 at 17:06

1
Nice proof. Simple and elegant. Thanks! – Michael Li Aug 9 '12 at 17:12

4
You can make this even simpler by just writing the $\sin x$ in the numerator as ${1 \over 2}(\sin x + \cos x) - {1 \over 2}(\cos x - \sin x)$. – Zarrax Aug 9 '12 at 17:12

2
@Zarrax, that magical step only helps in hiding what is going on :-) – Mariano Suárez-Alvarez♦ Aug 9 '12 at 18:09

5
– Erick Wong Aug 9 '12 at 18:29
show 1 more comment

## Did you find this question interesting? Try our newsletter

email address

Hint: $\sqrt{2}\sin(x+\pi/4)=\sin x +\cos x$, then substitute $x+\pi/4=z$

-

3
Thanks. This is a new formula for me. The pity is a number of constants appears meanwhile. – Michael Li Aug 9 '12 at 17:30

1
$\sin(A+B)=\sin A \cos B+\cos A \sin B$ actually. – Taxi Driver Aug 9 '12 at 17:32

2
Very nice, at least if we can regard $\int \csc t \,dt$ as a "book" integral. – André Nicolas Aug 9 '12 at 18:57

7
@Michael This formula generalizes to $$A\cos x+B\sin x=\sqrt{A^{2}+B^{2}}\sin \left( x+\arctan \frac{A}{B}\right) ,$$ which is very useful in (electrical) engineering. – Américo Tavares Aug 9 '12 at 20:05

You can do this without thinking: use the Weierstrass substitution to reduce the integral to a rational function, and integrate that as usual.

-

We can write the integrand as $$\begin{equation*} \frac{1}{1+\cot x} \end{equation*}$$ and use the substitution $u=\cot x$. Since $du=-\left( 1+u^{2}\right) dx$ we reduce it to a rational function

$$\begin{equation*} I:=\int \frac{\sin x}{\sin x+\cos x}dx=-\int \frac{1}{\left( 1+u\right) \left( u^{2}+1\right) }\,du. \end{equation*}$$

By expanding into partial fractions and using the identities

$$\begin{eqnarray*} \cot ^{2}x+1 &=&\csc ^{2}x \\ \arctan \left( \cot x\right) &=&\frac{\pi }{2}-x \\ \frac{\csc x}{1+\cot x} &=&\frac{1}{\sin x+\cos x} \end{eqnarray*}$$

we get

$$\begin{eqnarray*} I &=&-\frac{1}{2}\int \frac{1}{1+u}-\frac{u-1}{u^{2}+1}\,du \\ &=&-\frac{1}{2}\ln \left\vert 1+u\right\vert +\frac{1}{4}\ln \left( u^{2}+1\right) -\frac{1}{2}\arctan u +C\\ &=&-\frac{1}{2}\ln \left\vert 1+\cot x\right\vert +\frac{1}{4}\ln \left( \cot ^{2}x+1\right) -\frac{1}{2}\arctan \left( \cot x\right) +C \\ &=&-\frac{1}{2}\ln \left\vert 1+\cot x\right\vert +\frac{1}{4}\ln \left( \csc ^{2}x\right) +\frac{1}{2}x+\text{ Constant} \\ &=&\frac{1}{2}x-\frac{1}{2}\ln \left\vert \sin x+\cos x\right\vert +\text{ Constant.} \end{eqnarray*}$$

-

Write the numerator (here $\sin x$) as a linear combination of the denominator and the derivative of the denominator: $$A(\sin x+ \cos x) + B( \cos x- \sin x) = \sin x$$ Solve for $A$ and $B$ and split the fraction accordingly. Integrating give a linear term and an $\ln$

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 19, "mathjax_display_tex": 8, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8925178050994873, "perplexity_flag": "middle"}