How to apply the "Tabular Method" of integration by parts when neither $u$ nor $v$ in $\int uv \ dx$ becomes zero on differentiating multiple times? I came to know about the "Tabular Method" of integration by parts when I was looking for efficient ways of solving integrals involving the application of multiple times of integration by parts. I learnt about this method from the linked answers of the following questions:

*

*Efficiently evaluating $\int x^{4}e^{-x}dx$


*Integration by Parts Question: Integrate $x^3e^x$
The integrals in the above questions are of the form $\int uv \ dx$ where $u$ and $v$ are some functions of $x$ and one out of $u$ and $v$ become zero on differentiating multiple times. The factors which diminishes on multiple differentiation in the integrals $\int x^4e^{-x}\ dx$ and $\int x^3e^x\ dx$ are $x^4$ and $x^3$ respectively.
I think the success of the tabular method relies on the fact that one of the two factors vanish because almost all examples I looked on the internet consider the case when either of the two factors diminish on multiple differentiation. I wondered what if neither $u$ nor $v$ in the integral becomes zero after multiple differentiation (for example, when $u=\sin x$ and $v=e^x$). I thought of the consequences of this, and this is what I concluded the following:

If neither $u$ nor $v$ vanish after multiple differentiation then the integral $\int uv \ dx$ cannot be evaluated by the tabular method because the number of rows in the table cannot be ascertained.

So, is it possible to apply the method in such cases? If yes, how to apply the "Tabular Method" of integration by parts when neither $u$ nor $v$ in $\int uv \ dx$ becomes zero on differentiating multiple times? Or in other words, how can the method be generalised for all $u$ and $v$?
Details of my research:
The Mathonline article on "Tabular Integration" gives the following statement for $\int f(x)\ dx$ where $f(x)=g(x)h(x)$:

There are two types of Tabular Integration.
The first type is when one of the factors of $f(x)$ when differentiated multiple times goes to $0$.
The second type is when neither of the factors of $f(x)$ when differentiated multiple times goes to $0$.
Source : http://mathonline.wikidot.com/tabular-integration

So, it seems the tabular method could be generalised. Unfortunately, the second type is not discussed anywhere on the linked webpage.

Please note: If needed, usage of $\int uv\ dx= u\int v\ dx-\int u' \int v \ dx \ dx$ over other variants of integration by parts is much appreciated. Further, I'm a beginner in calculus (high school student), so kindly explain in a simple manner.
 A: In general, you cannot apply that method if it does not work :)  
It could be that, after a finite number of steps you come to a repeat.  Then you may get an equation to solve for your answer.
example (from here):  Evaluate $I := \int e^x\cos x\;dx$. Integratting $e^x$ we get:  $e^x, e^x, e^x, \dots$ never zero. Differentiating $\cos x$ we get $-\sin x,-\cos x, \sin x, \dots$ never zero.  But note, these mean
$$
I = \int e^x \cos x\;dx = e^x\cos x + \int e^x\sin x\;dx
\\= e^x\cos x + e^x\sin x -\int e^x\cos x\;dx
\\= e^x\cos x + e^x\sin x - I
$$
We get an equation to solve for $I$.  Result
$$
I = \frac{e^x(\sin x+\cos x)}{2}+C
$$
A: Having one of the factors go to zero is a special case, so usually you apply the tabular method and keep differentiating/integrating until the product of the factors is something you can integrate or deal with, I will elaborate with some examples:
say we'd like to integrate $I=\int \:\ln\left(x\right)\:dx$ using integration by parts and the tabular method:
$$\begin{pmatrix}u&dv\\ \ln\left(x\right)&1\\ \frac{1}{x}&x\end{pmatrix}$$
you stop after one time because you know that you can integrate $\int \:x\cdot \frac{1}{x}\:dx$
and your answer becomes $I=x\:\cdot \ln\left(x\right)-\int \:x\cdot \frac{1}{x}dx$
remember that the sign is alternating between terms.
Now lets do $\int \:e^x\sin\left(x\right)\:dx$
$$\begin{pmatrix}u&dv\\ \sin\left(x\right)&e^x\\ \cos\left(x\right)&e^x\\ -\sin\left(x\right)&e^x\end{pmatrix}$$
we stop after two times and get:
$\int \:e^x\sin\left(x\right)\:dx= e^x\sin\left(x\right)-e^x\cos\left(x\right)+-\int \:e^x\sin\left(x\right)\:dx$
by adding $\int \:e^x\sin\left(x\right)\:dx$ to both sides we get:
$2\int \:e^x\sin\left(x\right)\:dx=e^x\sin\left(x\right)-e^x\cos\left(x\right)+C_0$
$\int \:e^x\sin\left(x\right)\:dx=\frac{e^x}{2}\left(\sin\left(x\right)-\cos\left(x\right)\right) +C$
