# Integration by parts loop with coefficient

I leant that when the integral appears on the right side of the equation, it can be transferred accross to the left side, as in this post, but I'm trying to learn how to do this if there is a coefficient with the integral on the RHS. For example:

\begin{align}\int e^{-int}\sin(t)\,dt&=\frac{i}{n}e^{-int}\sin(t)-\int\frac{i}{n}e^{-int}\cos(t)\,dt \\ &=\frac{i}{n}e^{-int}\sin(t)-\left(-\frac{1}{n^2}e^{-int}\cos(t)-\int\frac{1}{n^2}e^{-int}\sin(t)\,dt\right)\end{align}

I can see that the integral appears on the RHS, and normally this could be transferred across to the LHS, but I'm not sure of how it all works with the $$\frac{1}{n^2}$$

Any help or direction would be much appreciated.

You have $$\int e^{-int} \sin(t) \, dt = \frac{i}{n}e^{-int}\sin(t) + \frac{1}{n^2}e^{-int}\cos(t) + \frac{1}{n^2} \int e^{-int}\sin(t)$$
So, $$\left( 1 - \frac{1}{n^2} \right) \int e^{-int} \sin(t) \, dt = \frac{i}{n}e^{-int}\sin(t) + \frac{1}{n^2}e^{-int}\cos(t)$$ i.e. $$\int e^{-int} \sin(t) \, dt = \left( 1 - \frac{1}{n^2} \right)^{-1} \left( \frac{i}{n}e^{-int}\sin(t) + \frac{1}{n^2}e^{-int}\cos(t) \right) \\ = \frac{n^2}{n^2-1} \left( \frac{i}{n}e^{-int}\sin(t) + \frac{1}{n^2}e^{-int}\cos(t) \right) \\ = \frac{in}{n^2-1}e^{-int}\sin(t) + \frac{1}{n^2-1}e^{-int}\cos(t) \\$$
If you denote $$\color{#df0000}{I := \int e^{- i n t} \sin t \,dt}$$, the equation becomes $$\color{#df0000}{I} = \frac{1}{n} e^{-int} \sin t + \frac{1}{n^2} e^{-int} \cos t + \frac{1}{n^2} \color{#df0000}{I} + C$$ for a constant $$C$$ of integration. Now, solve for $$\color{#df0000}{I}$$, which we can do iff $$n \neq \pm 1$$.
Remark Alternatively you can evaluate this integral by writing $$\sin t = \frac{1}{2 i} (e^{i t} - e^{-i t})$$ and distributing to get a linear combination of the integrals $$\int e^{-i(n \mp 1)t} dt$$---this formulation makes it clearer why the cases $$n = \pm 1$$ are qualitatively different from the case of generic $$n$$.
• Even in the OP formalism, you can understand the difference if you write down a definite integral with one limit fixed, and understand the $n=\pm 1$ case as a limit. The "algebraic weirdness" of this extra factor of $t$ is caused by the fact that the way we usually would write down, say, $\int e^{it} \sin(bt) dt$, isn't actually "the same antiderivative" for each $b \neq \pm 1$. – Ian Oct 23 '18 at 14:14
• @Ian I agree---what I mean by the last sentence is that for $n = \pm 1$ respectively the integral is just $\int dt$, which cannot be handled by the usual rule $\int e^{at} dt = \frac{1}{a} e^{at} + C$, and that this failure is perhaps easier to see than the one in, e.g., $\int e^{it} \sin (bt) \,dt$. – Travis Willse Oct 23 '18 at 14:18