10

$$\int \frac{(\ln(x))^2}{x^3} \, dx $$

Starting off with Integration by Parts $$ \begin{align} u = \ln(x)^2 &~~~ dv = x^{-3} \\\\ du = 2\ln(x)dx &~~~ v = \frac{x^{-2}}{-2} \end{align} $$

$$ \begin{align} \int \frac{(\ln(x))^2}{x^3} &= (\ln(x))^2 \left( \frac{-x^{-2}}{2} \right) -\frac{2}{2} \int \frac{\ln(x)}{x^2} \end{align} $$

Integration by parts again... $$ \begin{align} u = \ln(x) &\hspace{10mm} dv = \frac{1}{x^2} \\\\ du = \frac{1}{x}dx &\hspace{10mm} v = -\frac{1}{x} \\\\ -\frac{2}{2} \int \frac{\ln(x)}{x^2} &= -\ln(x) \left(\frac{1}{x} \right) + \int \frac{1}{x^2}dx \\\\ \end{align} $$

Integration by parts several times $\int \frac{1}{x^2}dx \rightarrow \int \frac{1}{x} \rightarrow \ln(x) + C$

Combining everything together, I get

$$ \int \frac{(\ln(x))^2}{x^3} = (\ln(x))^2 \left( \frac{-x^{-2}}{2} \right) -\ln(x) \left(\frac{1}{x} \right) - \ln(x) + C\\\\ = -\frac{(\ln(x))^2}{2x^2} - \frac{\ln(x)}{x} - \ln(x) + C $$

Is there a shorter way I could have done this? I think I got the right answer, but I am not really sure either. Checking my answer via differentiate doesn't seem like a feasible test strategy and even without time constraints still seems too complex for my level right now (but then maybe this is why I need the practice)

Integreek
  • 8,530
Evan Kim
  • 2,495
  • 4
    I don't think it's too complex for your level based on your work. You will sometimes have to do repeated integration by parts. – User203940 Feb 26 '19 at 21:58

7 Answers7

3

$$\begin{align} \int \frac{(\ln(x))^2}{x^3}dx & = \bigg((\ln(x))^2\times \frac{x^{-2}}{-2}\bigg)-\int\frac{2\ln(x)}{x}\times \frac{x^{-2}}{-2}dx \\ & =\bigg((\ln(x))^2\times \frac{x^{-2}}{-2}\bigg)+\int \ln(x)\times x^{-3}dx \\ & =\bigg((\ln(x))^2\times \frac{x^{-2}}{-2}\bigg)+\bigg(\ln(x)\times \frac{x^{-2}}{-2}\bigg)-\int\frac{1}{x}\times\frac{x^{-2}}{-2}dx \\ & =\bigg((\ln(x))^2\times \frac{x^{-2}}{-2}\bigg)+\bigg(\ln(x)\times \frac{x^{-2}}{-2}\bigg)+\frac{1}{2}\bigg(\frac{x^{-2}}{-2}\bigg)+C \\ & =\bigg(\frac{x^{-2}}{-2}\bigg)\bigg((\ln(x))^2+\ln(x)+\frac{1}{2}\bigg)+C \end{align}$$

zwim
  • 29,833
s0ulr3aper07
  • 1,157
  • 4
    Of the many other answers showing the same method, I find yours pretty and clean showing essential steps while not being too verbose. +1. – zwim Feb 26 '19 at 22:48
3

When doing integration by parts, I recommend using this little, trusty formula (the order whether $f(x)$ or $g(x)$ comes first does not matter):

$$\int f(x)g'(x)\,dx=f(x)g(x)-\int f'(x)g(x)\,dx.$$

$$ \begin{align} \int\frac{\ln^2{x}}{x^3}\,dx &=-\frac{1}{2}\int\ln^2{x}\left(\frac{1}{x^2}\right)'\,dx\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}}{x^2}-\int\frac{1}{x^2}(\ln^2{x})'\,dx\right)\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}}{x^2}-2\int\frac{\ln{x}}{x^3}\,dx\right)\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}}{x^2}-\frac{2}{-2}\int\ln{x}\left(\frac{1}{x^2}\right)'\,dx\right)\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}}{x^2}+\frac{\ln{x}}{x^2}-\int\frac{1}{x^2}(\ln{x})'\,dx\right)\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}+\ln{x}}{x^2}-\int\frac{1}{x^3}\,dx\right)\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}+\ln{x}}{x^2}-\int x^{-3}\,dx\right)\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}+\ln{x}}{x^2}-\frac{1}{-3+1}x^{-3+1}\right)\\ &=-\frac{1}{2}\left(\frac{\ln^2{x}+\ln{x}}{x^2}+\frac{1}{2x^2}\right)\\ &=-\frac{1}{2}\left(\frac{2\ln^2{x}+2\ln{x}}{2x^2}+\frac{1}{2x^2}\right)\\ &=-\frac{2\ln^2{x}+2\ln{x}+1}{4x^2}+C. \end{align} $$

Wolfram Alpha check

2

Starting off with Integration by Parts $$ \begin{align} u = \ln(x)^2 &~~~ dv = x^{-3} \\\\ \color{red}{du = \frac{2\ln(x)}{x}dx} &~~~ v = -\frac{x^{-2}}{2} \end{align} $$

(Don't forget chain rule!)

$$ \begin{align} \int \frac{(\ln(x))^2}{x^3} &= (\ln(x))^2 \left( \frac{-x^{-2}}{2} \right) \color{red}{+\int \frac{\ln(x)}{x^3}dx} \end{align} $$

(Notice that integration by parts is $uv - \int vdu$)

Now we want to figure out $$ \int \frac{\ln(x)}{x^3}dx$$ Let $$u = \ln(x), \ \ dv = \frac{dx}{x^3},$$ $$du = \frac{1}{x}dx, \ \ v = -\frac{x^{-2}}{2}.$$ Then we have

$$ \int \frac{\ln(x)}{x^3}dx = -\frac{x^{-2}}{2} \ln(x) + \frac{1}{2}\int\frac{1}{x^3}dx.$$

Now $$ \int \frac{1}{x^3}dx = -\frac{x^{-2}}{2} + C,$$ so putting it all back together we have $$ -\frac{\ln(x)^2}{2x^2} - \frac{\ln(x)}{2x^2} - \frac{1}{4x^2} + C.$$

User203940
  • 2,789
2

Let's prove by induction $$\displaystyle I_p(n)=\int\dfrac{\ln(x)^n}{x^p}\mathop{dx}=\dfrac{P_n(\ln(x))}{x^{p-1}}$$ where $P_n$ is a polynomial of degree $n$.

We will assume in the following $p>1$, so we can carry on integration by parts.

$\displaystyle I_p(0)=\int \dfrac{\mathop{dx}}{x^p}=\dfrac{1-p}{x^{p-1}}$ thus $P_0(x)=1-p$ is a polynomial of degree $0$

$\displaystyle I_p(n+1)=\int\dfrac{\ln(x)^{n+1}}{x^p}\mathop{dx}=\left[\ln(x)^{n+1}\times\dfrac{1-p}{x^{p-1}}\right]-\int \dfrac{(n+1)\ln(x)^n}{x}\dfrac {1-p}{x^{p-1}}\mathop{dx}=\alpha\dfrac{\ln(x)^{n+1}}{x^{p-1}}+\beta I_p(n)$

By induction hypothesis $P_{n+1}(x)=\alpha x^{n+1}+\beta P_n(x)$ is a polynomial of degree $n+1$ and the induction is verified.


Of course we could have calculated the exact coefficients, but it makes it harder to remember the formula. In fact we were just interested in the general form of the result.


In our case we have $\displaystyle I_3(2)=\int\dfrac{\ln(x)^2}{x^3}\mathop{dx}=\dfrac{a\ln(x)^2+b\ln(x)+c}{x^2}$


Derivate it and identify the coefficients : $x^3\times {I_3}'(2)=-2a\ln(x)^2-(2b-2a)\ln(x)-(2c-b)\iff\begin{cases}-2a=1\\2b-2a=0\\2c-b=0\end{cases}\iff \begin{cases}a=-\frac 12\\b=-\frac 12\\c=-\frac 14\end{cases}$

zwim
  • 29,833
2

Differentiate under integral sign $$\int \frac{\ln^2x}{x^3} dx =\frac{d^2}{da^2}\bigg(\int x^adx\bigg)_{a=-3} = \frac{d^2}{da^2}\frac{x^{a+1}}{a+1}\bigg|_{a=-3}\\ = -\frac{2\ln^2x+2\ln x+1}{4x^2} $$

Ace
  • 2,159
1

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ $$ \left\{\begin{array}{rcl} \ds{\int{x^{\nu} \over x^{3}}\,\dd x} & \ds{=} & \ds{x^{\nu - 2} \over \nu - 2} \\[3mm] \ds{\int{x^{\nu}\ln\pars{x} \over x^{3}}\,\dd x} & \ds{=} & \ds{-\,{x^{\nu - 2} \over \pars{\nu - 2}^{2}} + {x^{\nu - 2}\ln\pars{x} \over \nu - 2}} \\[3mm] \ds{\int{x^{\nu}\ln^{2}\pars{x} \over x^{3}}\,\dd x} & \ds{=} & \ds{{2x^{\nu - 2} \over \pars{\nu - 2}^{3}} - {2x^{\nu - 2}\ln\pars{x} \over \pars{\nu - 2}^{2}} + {x^{\nu - 2}\ln^{2}\pars{x} \over \nu - 2}} \end{array}\right. $$

$\ds{\nu \to 0 \implies \int{\ln^{2}\pars{x} \over x^{3}}\,\dd x = \bbx{-\,{1 + 2\ln\pars{x} + 2\ln^{2}\pars{x} \over 4x^{2}} + \mbox{a constant}}}$

Felix Marin
  • 94,079
1

To make life easier, put $x=e^{\alpha t}$ such that the power of $e^t$ in the integrand becomes $1$:

$$\begin{align}\mathcal I&=\int\frac{\ln^2{x}}{x^3}\mathrm dx\\&=\int\frac{(\alpha t)^2}{e^{3\alpha t}}\alpha e^{\alpha t}\mathrm dt\\&=\alpha^3\int t^2 e^{-2\alpha t}\mathrm dt\end{align}$$

Hence, $\alpha=\frac{-1}2$.

$$\mathcal I=\frac{-1}8\int t^2e^t\mathrm dt$$

Using the result

$$\int e^x(f(x)+f’(x))\mathrm dx=e^xf(x)+C$$

the integral $\mathcal I$ becomes

$$\begin{align}\mathcal I&=\frac{-1}8\int e^t\left[(t^2+2t)+(-2t-2)+(2+0)\right]\mathrm dt\\&=\frac{-1}8(t^2-2t+2)e^t+C\\&=\frac{-\ln^2x}{2x^2}-\frac{\ln x}{2x^2}-\frac1{4x^2}+C\end{align}$$

Integreek
  • 8,530
  • Could you explain how you used $\int e^x(f(x)+f’(x))\mathrm dx=e^xf(x)+C$ – Amrut Ayan Sep 14 '24 at 05:32
  • @whatamidoing, it is based on integration by parts: $$\int e^x(f(x)+f’(x))\mathrm dx$$ $$=\int e^xf(x)\mathrm dx+\int e^xf’(x)\mathrm dx$$ $$=\int e^xf(x)\mathrm dx+e^x\int f'(x)\mathrm dx -\int \frac{\mathrm d}{\mathrm dx}(e^x)(\int f'(x)\mathrm dx)\mathrm dx$$ $$=\int e^xf(x)\mathrm dx+e^xf(x)-\int e^xf(x)\mathrm dx$$ $$=e^xf(x)+C$$ – Integreek Sep 14 '24 at 05:40
  • I was asking about how you used that property to solve $\mathcal I=\frac{-1}{8}\int t^2e^t\mathrm dt$, sorry if the initial question was misdirecting – Amrut Ayan Sep 14 '24 at 05:41
  • @whatamidoing, this formula is a short trick and is extremely useful when integrating a polynomial multiplied with an exponential, since the ${(n+1)}^{th}$ derivative of an n-degree polynomial is zero. Here, we can split $t^2$ as $(t^2+2t)+(-2t-2)+(2+0)$ such that the formula can be applied to each bracket. – Integreek Sep 14 '24 at 05:44
  • Oh that was lovely, good work (+1) – Amrut Ayan Sep 14 '24 at 05:46