# Integration using “method of judicious guessing”

My calculus-book gives an example of integration using the method of judicious guessing. But I do not intuit the method very well.

QUESTION: How does the derivative of $f_{mn}(x)$ "suggest that we try" $I=Px^4\left(\log {x}\right)^2 +Qx^4\log{x}+Rx^4+C$? Where does this trial formula come from?

The example goes as follows:

Find the derivative of $f_{mn}(x)=x^m\left(\log {x}\right)^n$ and use the result to suggest a trial formula for $I=\int x^3\left(\log {x}\right)^2dx$. Thus evaluate this integral.

Solution: We have $$f'_{mn}(x)=mx^{m-1}\left(\log {x}\right)^n+nx^{m-1}\left(\log {x}\right)^{n-1}.$$ This suggests that we try $$I=Px^4\left(\log {x}\right)^2+Qx^4\log{x}+Rx^4+C$$ for constants $P$, $Q$, $R$ and $C$. Differentiating we get $$\frac{dI}{dx} = 4Px^3\left(\log {x}\right)^2 + 2Px^3\log{x} + 4Qx^3\log{x} + Qx^3 + 4Rx^3 = x^3\left(\log {x}\right)^2,$$ solving for $P$, $Q$ and $R$ we arrive at the right answer: $$\int x^3\left(\log {x}\right)^2dx=\frac{1}{4}x^4\left(\log {x}\right)^2-\frac{1}{8}x^4\log{x}+\frac{1}{32}x^4+C.$$

Please note my level of mathematics is still "in development": I am learning without a teacher.

BACKGROUND: In my efforts I did notice the following, which also results in the right answer: $$\frac{d}{dx}x^m\left(\log {x}\right)^n=mx^{m-1}\left(\log {x}\right)^n+nx^{m-1}\left(\log {x}\right)^{n-1}.$$ Integrating both sides we get: $$x^m\left(\log {x}\right)^n=m\int x^{m-1}\left(\log {x}\right)^n dx+n\int x^{m-1}\left(\log {x}\right)^{n-1}dx.$$ Now we can define $g_{mn}(x)$ as follows: $$g_{mn}\left(x\right)=\int x^{m-1}\left(\log {x}\right)^n dx=\frac{1}{m}x^m\left(\log {x}\right)^n-\frac{n}{m}\int x^{m-1}\left(\log {x}\right)^{n-1}dx.$$ Taking $m=4$ and $n=2$ we get: \begin{align} I&=\int x^3\left(\log {x}\right)^2dx=g_{42}(x)=\frac{1}{4}x^4\left(\log {x}\right)^2-\frac{1}{2}\int x^3\log{x}\,dx\\ &=\frac{1}{4}x^4\left(\log {x}\right)^2-\frac{1}{2}g_{41}(x)=\frac{1}{4}x^4\left(\log {x}\right)^2-\frac{1}{8}x^4\log{x}+\frac{1}{32}x^4+C. \end{align}

More or less, when the author of the textbook makes their guess of the form of the integral, they are eliding exactly the work that you did to calculate the integral.

Essentially, there is an inductive argument at work here. So, the critical observation that the textbook asks you to make is the following one: $$f_{m+1,n}'=m\cdot f_{m,n}+n\cdot f_{m,n-1}.$$ The idea is then that if you want to integrate $f_{m,n}$, what you need to do is the following:

• Calculate an anti-derivative for $f_{m,n-1}$.

• Subtract $n$ times that anti-derivative from $f_{m+1,n}$ and divide by $m$.

The idea then is that, if you repeat this argument until you get to calculating an anti-derivative for $f_{m,0}$ - which is just some multiple of $f_{m+1,0}$ - you see that the answer should be some weighted sum of the following functions $$f_{m+1,n},\,f_{m+1,n-1},\,f_{m+1,n-2},\ldots,f_{m+1,2},\,f_{m+1,1},\,f_{m+1,0}.$$ This is just what happens when you "unroll" the process to figure out the antiderivative of $f_{m,n}$ by using the antiderivative for $f_{m,n-1}$, which can be determined by knowing the antiderivative for $f_{m,n-2}$ and so on.

Basically, the textbook runs this argument by figuring out what the terms will be, ignoring the factors of $n$ and $m$ that appear, then figuring out what the coefficients have to be at the end. Your method does the same idea, but you explicitly keep track of the constants at each step.

The clever step here is in seeing that $f_{m+1,n}'=m\cdot f_{m,n} + n\cdot f_{m,n-1}$. Once you have that, you see that you can relate your desired anti-derivative to a simpler one, and then proceed. I would say that the "judicious guess" is this step. As you discovered, there are multiple ways to proceed once you get to this step - and whatever you do, it's a somewhat straightforward calculation from that point on.

Of course one can say: The expertise of the author led him to this "Ansatz". Note that you cannot make a mistake by trying it. If the true solution is not in the bag of proposed functions the computation will reveal this.

Your own efforts resulted in the recursion formula $$\int x^m\log^n x\>dx=\langle{1\over m+1}x^{m+1}\log^n x\rangle-{n\over m+1}\int x^m \log^{n-1} x\>dx\qquad(n\geq1)\ .$$ Here $m$ is fixed, and $n$ is the recursion variable, and the $\langle\ldots\rangle$ notation means "up to an additive constant". It is then pretty obvious, and can be verified by a simple induction proof, that the complete solution will be of the form $$\int x^m\log^n x\>dx=\bigl\langle x^{m+1}\sum_{k=0}^n c_k\log^{n-k}x\bigr\rangle\tag{1}$$ with certain rational coefficients $c_k$, e.g., $c_0={1\over m+1}$. Knowing this it is perhaps simpler to start right away with the "Ansatz" $(1)$ with indetermined coefficients $c_k$ than going through an $n$ steps of the recursion with all its integral signs.

But there is also an " abstract nonsense" proof that the proposed approach works: The result shows that it is not sufficient to consider "monomials" of the form $x^m\log^n x$ and integrate them in a single step. For a general theory we have to deal with the full space of functions $f$ of the form $$f(x)=x^m p(\log x)\qquad(x>0)\ ,\tag{2}$$ where $p(t)$ is a polynomial in an "indeterminate" $t$.

Denote the vector space of all polynomials $p(t)$ of degree $\leq n$ by $P_n$, and denote the vector space of all functions $(2)$ with $p\in P_n$ by $V_{m,n}$. For an $f\in V_{m,n}$ one computes $$f'(x)=x^{m-1}\bigl(m p(\log x)+p'(\log x)\bigr)\ ,\tag{3}$$ which implies that $f'\in V_{m-1,\, n}\>$.

This shows that the derivation $D:\>f\mapsto f'$ maps $V_{m,n}$ to $V_{m-1,\, n}$. The problem at hand is about the converse direction: We are given a $g\in V_{m-1,\,n}$ and have to show that $g$ is the $G'$ of some $G\in V_{m,n}$, in other words: that $$D:\>V_{m,n}\to V_{m-1,\, n}\ ,\qquad f\mapsto f'\tag{4}$$ is surjective.

In $(3)$ we see a linear map $\psi:\>P_n\to P_n$ at work, namely $$\psi:\quad P_n\to P_n,\qquad p\mapsto mp +p'\ .$$ When $m>0$ this map is injective, because $\psi(p)=0$, i.e., $p'=-mp$, implies $p=0$, or $p$ would be an exponential function. As $P_n$ is finite dimensional we can conclude that $\psi$ is also surjective, hence $(4)$ is surjective as well. This is saying that any $g\in V_{m-1, \,n}$ is the derivative of some $G\in V_{m,\,n}$. In particular this is the case for the function $g(x):=x^{m-1}\,(\log x)^n$.

• I don't doubt this answer is correct; it's just that my level of math is not sufficient yet to understand it. For example, I don't no what a vector space is, nor do I know what a linear map is, nor injective or surjective... further explanation or simplification would be much appreciated! – GambitSquared May 18 '18 at 19:33
• That's o.k. But you cannot expect a conceptual explanation of this "method" without bringing the concepts into the game. – Christian Blatter May 18 '18 at 19:39
• Fair enough... it's just that my calculus book (calculus a complete course) hasn't covered these concepts while still expecting that the trial formula is kind of obvious. Therefore I was wondering what "obvious" pattern I was missing here... – GambitSquared May 18 '18 at 19:44

Let me try to give a little insight into my thinking process when I see problems like that.

Objective: Compute explicitly integral $\,I=\int x^3\log^2 x\,dx$ by "trial and error".

Interpretation: Authors want you to guess "general form" of solution (meaning they want you to plug in some expression that you think might be solution, but without necessarily knowing exact coefficients, which can be adjusted later).

Hint: find the derivative of $\,f_{mn}\left(x\right)=x^m\log^nx$ and guess general solution of integral $\,I=\int x^3\log^2 x\,dx$ from there.

Interpretation: We need to guess a function whose derivative is $\, x^3\log^2 x$. Since the result is product of powers of $x$ and $\log x$, it is reasonable to assume that the integrand has similar form, with maybe more terms and higher powers, but it should still have product of powers of $x$ and $\log x$ in order for its derivative to have required form.

## Approach to Solution

Following the hint, we write down derivative of $\,f_{mn}\left(x\right)$ as $f'_{mn}(x)=mx^{m-1}\log^n{x}+nx^{m-1}\log^{n-1}{x}$. Thus if we want the derivative of function to be $x^3\log^2 x$ we have $m-1 = 3$ as well as $n = 2$ or $n-1=2$.

Moreover, the derivative of $f_{mn}(x)$ has more than one term, thus if we seek for expression of whose derivative is $x^3\log^2 x$ we need to take linear combination of functions of the form $f_{mn}$ hoping that redundunt terms will cancel out.

More specifically, we see that in the integrand power of $\log x$ is smaller by $1$ than the power of $x$, thus we conclude that we want to get rid of the term $x^{m-1}\log^{n-1}{x}$ since it has the same powers.

From here on you can use trial and error to try to match and cancel redundant terms.

Note that$$f_{m, n}'(x) = mx^{m - 1} (\ln x)^n + nx^{m - 1} (\ln x)^{n - 1} = P_{m, n}(x, \ln x),$$ where $P_{m, n}(x, y) = mx^{m - 1} y^n + nx^{m - 1} y^{n - 1}$ is a polynomial of $x$ and $y$, and $\deg_x P_{m, n} = m - 1$, $\deg_y P_{m, n} = n$.

First, the primitive function of $f_{m_0, n_0}(x) = x^{m_0} (\ln x)^{n_0}$ can be guessed as a linear combination of some $f_{m, n}$'s plus a constant $C$. Next, note that $P_{m, n}$ is a monomial of degree $m - 1$ with respect to $x$, i.e. $P_{m, n}(x, y) = x^{m - 1} Q_{m, n}(y)$, thus the combination should be of $f_{m, n}$'s all with $m = m_0 + 1$. Now, since $\deg_y P_{m, n} = n$, then the $f_{m_0 + 1, n}$'s in the combination should satisfy $0 \leqslant n \leqslant n_0$. Therefore, the guessed form is$$F_{m_0, n_0}(x) = \sum_{k = 0}^{n_0} a_k f_{m_0 + 1, n}(x) + C.$$

• What is the meaning of $m_0$ and $n_0$? – GambitSquared May 18 '18 at 11:40
• @GambitSquared Some given positive integers. In your case, $(m_0,n_0)=(3,2)$. – Saad May 18 '18 at 11:54