indefinite integral problem $\int x^n \cos(mx) \text{d}x$ I was going through my old calculus book and found a integral problem, i generalised the problem and tried to solve it.I am not sure if the solution is correct and also what would happen if n tends to infinity. Is there any other method to solve this problem? please refer the below link
https://1drv.ms/f/s!AuU4aSVY7XTLcPp2rr8x0Cf6ZLc
 A: 
Is there any other method to solve this problem?

Yes. 
Hint. One may start with
$$
\int e^{(a+im)x}dx=\frac{e^{(a+im)x}}{a+im},\qquad \qquad (a,m)\in \mathbb{R}^2\backslash\left\{(0,0)\right\},
$$ then one may differentiate $n$ times with respect to $a$, using the general Leibniz rule for a product and considering $a=0$ in the real part of each side.
A: It s more convenient to study the exponential form (of which f is the real part)
$$g(\text{n},\text{m},x)\text{=}\int x^n \exp (i m x) \, dx$$
and observe that the factor $x^n$ can be generated by n-fold differentiation of the exponential with respect to m.
Exchanging integration and differentiation, and carrying out the integration over $x$ for $n = 0$ gives for $g$
$$\frac{\frac{\partial ^n}{\partial m^n}\left(-\frac{i e^{i m x}}{m}\right)}{(i x)^n}$$
Carrying out the differentiation according to the Leibniz rule leads to the expression
$$g=-i e^{i m x} \sum _{k=0}^n \frac{(-1)^k k! \binom{n}{k} (i x)^{n-k}}{m^{k+1}}$$
$g$ can also be expressed in compact form using the incomplete $\Gamma$ function
$$g = -\frac{i (i x)^n (-i m x)^{-n} \Gamma (n+1,-i m x)}{m}$$
$f$ is then given by the real part.
