# Computing an indefinite integral: $\int \frac{2n!\sin x + x^n }{e^x + \sin x + \cos x + P_n (x)}\, dx$

Let $\displaystyle P_n (x) = 1 + \frac{x}{1!} + \frac{x^2 }{2!} + \cdots + \frac{x^n }{n!} \$ and $$I(x) = \int \frac{2n!\sin x + x^n }{e^x + \sin x + \cos x + P_n (x)}\, dx$$ (where $\ n \to \infty \$).

This problem is REALLY frustrating to me at the moment, it's 6 AM here and I've been trying to sort it out since 4:30 AM. First of all, I don't get the use of the $P_n(x)$ notation, isn't that just $e^x$ ? Anyhow...None of my approaches yielded any useful results, so I'm reaching out to you. Can someone suggest anything, at all ?

It would be much appreciated, thanks a lot!

EDIT : I managed to solve part of it, I'm now stuck with $I(x) = n!(x - \log [2e^x + \sin (x) + \cos (x)] + \int {\frac{{x^n }}{{e^x + \sin x + \cos x + P_n (x)}}} dx$.

Can't really figure out if this is much better, but that's all I could get up until this point.

• $$\lim_{n\to\infty}P_n(x)=e^x$$ – lab bhattacharjee Sep 14 '14 at 3:01
• Uh yeah I already mentioned that in the body of my question – Victor Sep 14 '14 at 3:05
• Just to clarify, is that $(2n)!$ or $2(n!)$? – ClassicStyle Sep 14 '14 at 3:14
• Hey @TylerHG that's $2(n!)$ – Victor Sep 14 '14 at 3:14
• That last integral can be simplified to $$\int \frac{x^n}{2 e^x+\sqrt2 \sin(x+\frac{\pi}{4})}$$ but I don't know if it really is a simplification. – UserX Sep 14 '14 at 3:47

This is a tricky integral!

Let's prove that

\begin{align} \int \frac{2n!\sin x + x^n }{e^x + \sin x + \cos x + P_n (x)} {\rm d} x & = n! \:x-n!\:\log |e^x+\cos x+\sin x+P_n(x)| +C, \end{align}

where $C$ is any constant (depending on $n$).

Observe that $$P_n (x) = 1 + \frac{x}{1!} + \frac{x^2 }{2!} + \cdots + \frac{x^n }{n!}$$ is such that $$P_n '(x) = 1 + \frac{x}{1!} + \frac{x^2 }{2!} + \cdots + \frac{x^{n-1} }{(n-1)!}= P_n (x) -\frac{x^n}{n!}.$$ Setting $$f(x):=e^x+\cos x+\sin x+P_n(x)$$ we then have $$f'(x)=e^x-\sin x+\cos x+P_n(x)-\frac{x^n}{n!}$$ and $$f(x)-f'(x)=2\sin x+\frac{x^n}{n!}$$ Hence your integral may be rewritten as \begin{align} \int \frac{2n!\sin x + x^n }{e^x + \sin x + \cos x + P_n (x)} {\rm d} x &= n! \int \frac{f(x)-f'(x) }{f(x)}{\rm d} x \\\\ &= n! \int {\rm d} x-n! \int \frac{f'(x) }{f(x)}{\rm d} x \\\\ & = n! \:x-n!\:\log |f(x)| +C \\\\ & = n! \:x-n!\:\log |e^x+\cos x+\sin x+P_n(x)| +C, \end{align} where $C$ is a constant (depending on $n$).

• Wow!That was really, I mean really cool.. +1 – Victor Sep 14 '14 at 12:35
• Awesome answer +1 – Mike Miller Dec 30 '14 at 22:47
• impressive :) (+1) – tired Feb 11 '15 at 12:09

Is the $n\rightarrow\infty$ apply to the $n$ in the integral numerator as well as to $P_{n}(x)$? If so, then my guess is that either this is an incorrectly posed problem or the answer is totally divergent to infinity due to the $n!$ in the numerator. I have been working to find ways to get rid of this but the first integral shows that the first part diverges as $n\rightarrow\infty$.