# Recurrence relation for $I_n=\int (\sin x+\cos x)^n \,\Bbb dx$

We can obtain a recurrence relation for $$I_n=\int (\sin x+\cos x)^n \,\Bbb dx$$ as $$nI_n= (\sin x+ \cos x)^{n-1} (\sin x- \cos x)+2(n-1)I_{n-2} \tag{\ast}$$ By writing $$I_n=2^{n/2}J_n$$, where $$J_n=\int \sin^n (x+a) \,\Bbb dx=\int \sin ^n t \,\Bbb dt$$ \begin{align} J_n&=\int \sin ^{n-2} t (1-\cos^2t) \,\Bbb dt \\ &=J_{n-2}-\int \cos t ~ \sin^{n-2}t ~\cos t \,\Bbb dt \end{align} Integration by parts yields $$J_n=J_{n-2}-\cos t~ \frac{\sin^{n-1} t}{n-1}-\frac{1}{n-1}J_n\implies nJ_n=(n-1)J_n-\cos t ~\sin^{n-1} t.$$ The question is: How else can one prove/get $$(\ast)$$?

• You are missing a factor of $1/n$ in your recurrence. Commented Nov 24, 2023 at 5:15
• Oh! yes, thanks, corrected it Commented Nov 24, 2023 at 5:35

You can write $$I_n = \int (\sin x + \cos x)^n \,dx = \int (\sin x + \cos x)^{n-1}(\sin x - \cos x)'\,dx$$ and integrate by parts to get $$I_n = (\sin x + \cos x)^{n-1}(\sin x - \cos x) + (n-1)\int(1-2\sin x \cos x)(\sin x + \cos x)^{n-2}\,dx$$ Now write $$1-2\sin x \cos x = 2 - (\sin x + \cos x)^2$$ and substitute that into the last expression to get $$n I_n = (\sin x + \cos x)^{n-1}(\sin x - \cos x) +2(n-1)I_{n-2}$$

Multiplying both sides of the identity

$$(\sin x +\cos x)^2=-(\sin x-\cos x)^2+2$$

with $$n(\sin x+\cos x)^{n-2}$$ we have

$$n(\sin x +\cos x)^n= -n(\sin x+\cos x)^{n-2}(\sin x-\cos x)^2+2n(\sin x+\cos x)^{n-2}.$$

Arranging the right hand side we have

$$(nI_n)'=\color{blue}{(-n+1)(\sin x+\cos x)^{n-2}(\sin x-\cos x)^2}\color{red}{-(\sin x+\cos x)^{n-2}(\sin x-\cos x)^2 +2(\sin x+\cos x)^{n-2}}+2(n-1)(\sin x+\cos x)^{n-2}$$

and

$$(nI_n)'=\color{blue}{(n-1)(\sin x+\cos x)^{n-2}(\cos x-\sin x)(\sin x-\cos x)}+\color{red}{(\sin x+\cos x)^{n-1}(\cos x +\sin x)}+(2(n-1)I_{n-2})'$$

and

$$(nI_n)'=(\color{purple}{(\sin x+\cos x)^{n-1}(\sin x-\cos x)})'+(2(n-1)I_{n-2})'.$$

Finally integrating we obtain the recurrence relation

$$nI_n=(\sin x+\cos x)^{n-1}(\sin x-\cos x)+2(n-1)I_{n-2}.$$

• Recurrence relations are generally obtained by using integration by parts as stated in previous answers or in the question, do not use differentiation in such cases because that will yield nothing and for finding the final recurrence relation, you will have to integrate which will be rather more difficult. Commented Nov 24, 2023 at 6:11
• It disproved the formula given. Commented Nov 24, 2023 at 6:14
• Mathematically you may be correct, I have not checked your relation becaause you did not even explain how you got it, but moreover it does not actualy answer OP's question. If you disproved the given formula, kindly show your solution and present the formula you feel to be correct Commented Nov 24, 2023 at 6:18
• I could disprove it before the accepted answer if I had a pen, actually I uploaded my answer before. Commented Nov 24, 2023 at 6:29
• Whenever you get a pen, kindly work on letting OP know how you disproved his answer because right now it is not (atleast for me) clearly understandable how you would proceed using this and how you even got this. Commented Nov 24, 2023 at 6:33