Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to express in a closed form the integral $$\int_{0}^{\pi/2}\frac{\sin \left ( ax \right )}{\sin x+\cos x}\, {\rm d}x,\,\,\, a\in \mathbb{N}$$

Well, I find it very difficult. Well, I know how to express the integral $$\int_{0}^{\pi/2}\frac{\sin x}{\sin x+\cos x}\,{\rm d}x=\int_{0}^{\pi/2}\frac{\cos x}{\sin x+\cos x}\, {\rm d}x=\frac{\pi}{4}$$ by applying the sub $u=\frac{\pi}{2}-x$ , but in general I don't have a clue.

If someone could help me , that would be nice!

share|cite|improve this question
Nice question. Wolfram Alpha can't find a closed formula. – Siminore Jul 20 '14 at 10:58
After a substitution $t=x-\pi/4$ we get $I=\sqrt2\sin\frac{\pi a}{4}\int_0^{\pi/4}\frac{\cos ax}{\cos x}\,dx$. The last integral could be treated using recurrence relation $\cos ax=2\cos x\cos(a-1)x-\cos(a-2)x$. I hope this might help. – CuriousGuest Jul 20 '14 at 11:14
@CuriousGuest Well, how possible is to evaluate the last integral? I think I've seen it somewhere before... Nice approach though, thnx! – Tolaso Jul 20 '14 at 11:25
@Tolaso It's easy to integrate it from 0 to $\pi$ (in this case $I_a=I_{a-2}$), but for segment $[0,\pi/4]$ the recurrence relation isn't so nice. – CuriousGuest Jul 20 '14 at 11:28
@CuriousGuest That is why I asked that. Therefore , I don't know.. I only know the integrals you've mentioned $\int_0^\pi \frac{sin ax}{\sin x}\, dx$ and that other with cosine. Anyway, thanks a lot for your answer. I'll take a look at it. – Tolaso Jul 20 '14 at 11:35
up vote 2 down vote accepted

If you are really interested in a closed form formula then let's consider the integral

$$ I = \int_{0}^{\pi/2} \frac{e^{inx}}{\cos(x)+\sin(x)}dx $$

where your integral equals to the imaginary part of $I$. $I$ can have the closed form in terms of the Lerch zeta function

$$ I = \frac{(1-i) e^{\frac{i\pi n}{2}}} {2}\left( \Phi \left( -i,1,\frac{n+1}{2}\right) - \Phi \left( i,1, \frac{n+1}{2} \right ) \right) . $$


1) Maple $17$ can not give an answer for this integral! I do not know about Maple 18. Already a different form for the answer, computed by Mathematica $9$, was posted.

2) The real part of $I$ evaluates the integral

$$ \int_{0}^{\pi/2}\frac{\cos(nx)}{\cos(x)+\sin(x)}dx. $$

share|cite|improve this answer
This one is beautiful ! Thanks for this answer – Claude Leibovici Jul 20 '14 at 13:11
I have a problem : for $n=1$ the result from your formula seems to be $\frac{\log (2)}{2}$ – Claude Leibovici Jul 20 '14 at 13:19
@ClaudeLeibovici: Thanks for the comment. I really appreciate it. – Mhenni Benghorbal Jul 20 '14 at 13:19
@ClaudeLeibovici: It gave me $\pi/4+i\pi/4$. Make sure you copied it correctly. – Mhenni Benghorbal Jul 20 '14 at 13:21
@MhenniBenghorbal Great ! Thank you all for your answers. – Tolaso Jul 20 '14 at 13:31

You have an answer from Vladimir but I had fun computing the integral for some values of $n$ and I let that for your curiosity.

Let $$I_n=\int_{0}^{\pi/2}\frac{\sin \left ( ax \right )}{\sin x+\cos x}\, {\rm d}x$$ $$I_1=\frac{\pi }{4}$$ $$I_2=2-\sqrt{2} \tanh ^{-1}\left(\frac{1}{\sqrt{2}}\right)$$ $$I_3=1-\frac{\pi }{4}$$ $$I_4=0$$ $$I_5=1-\frac{\pi }{4}$$ $$I_6=\sqrt{2} \tanh ^{-1}\left(\frac{1}{\sqrt{2}}\right)-\frac{14}{15}$$ $$I_7=\frac{\pi }{4}-\frac{2}{3}$$ $$I_8=0$$ $$I_9=\frac{\pi }{4}-\frac{2}{3}$$ $$I_{10}=\frac{454}{315}-\sqrt{2} \tanh ^{-1}\left(\frac{1}{\sqrt{2}}\right)$$ $$I_{11}=\frac{13}{15}-\frac{\pi }{4}$$ $$I_{12}=0$$ We can understand that the general formula must be far away from simple.

share|cite|improve this answer
Well, I had computed the three first values of the integral (that is for $a=1, 2, 3$) got the same results.. and then I gave up. OK, Vladimirs answer is good but I think that a closed form may not exist... What I observe now , from your post, is that every 4 four values the integral equals zero. That may gives us a pattern.. who knows? – Tolaso Jul 20 '14 at 12:58
There is closed form ... which is a nightmare (at least, to me). The fact that every four values the integral equals zero is obvious since the numerator is $\sin(4kx)$ and the integration is between $0$ and $\frac{\pi }{2}$. Good luck and enjoy ! Cheers :) – Claude Leibovici Jul 20 '14 at 13:02
I'd imagine that it'd simplify things somewhat to divide into cases of $n$ mod 4 owing to the distinct difference in behaviors. – Semiclassical Jul 20 '14 at 14:20

This is $$ -\Biggl(\left(\frac{1}{2}+\frac{i}{2}\right) e^{-\frac{1}{2} i \pi n} \biggl(e^{\frac{i \pi n}{2}} \biggl((n-1) \biggl(e^{\frac{i \pi n}{2}} \, _2F_1\biggl(1,\frac{n+1}{2};\frac{n+3}{2};-i\biggr)\\+i \, _2F_1\biggl(1,\frac{n+1}{2};\frac{n+3}{2};i\biggr)\biggr)+i (n+1) \, _2F_1\biggl(1,\frac{1-n}{2};\frac{3-n}{2};i\biggr)\biggr)\\+(n+1) \, _2F_1\biggl(1,\frac{1-n}{2};\frac{3-n}{2};-i\biggr)\biggr)\Biggr)/(n^2-1) $$ according to Wolfram Mathematica$^{TM}$ 9

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.