Integral with parameter

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!

Solutions Collecting From Web of "Integral with parameter"

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) . $$

Note:

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. $$

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.

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