# Integration by substitution, but I can't deduce what is happening here

$$\int \left(f^{''}(x)\right)^2 dx = \int f^{''}(x)df^{'}(x) = - \int f^{'''}(x)f^{'}(x)dx = -\int f^{'''}(x)df(x) = \int f^{(4)}(x)f(x)dx$$

I understand the first and third equalities, but I don't get what happened in the second and fourth.

The first equality is a substitution $$u=f^{'}(x)$$, and similarly the third is $$u=f(x)$$. However I'm not so sure about the second and fourth. Since the idea should be integration by substitution, I thought of something like this:

$$\int f^{''}(x)df^{'}(x) = \int f^{''}(x)\cdot 1 df^{'}(x) = f^{''}(x)\cdot f^{'}(x) - \int \frac{df^{''}(x)}{df^{'}(x)}f^{'}(x) df^{'}(x).$$

However, what is $$\frac{df^{''}(x)}{df^{'}(x)}$$? And even if $$\frac{df^{''}(x)}{df^{'}(x)} = f^{'''}(x)$$, where did $$f^{''}(x)\cdot f^{'}(x)$$ go? Something feels suspicious here.

Edit: I meant to say 'the idea should be integration by parts'. On the second equation 'group' I tried the int by parts idea but can't figure it out.

• seems to be an integration by parts. But this only makes sense if you're integrating over all of $\Bbb{R}$ for example and the functions decay sufficiently quickly, so that you can throw away the boundary terms. Jan 26, 2023 at 17:36
• I think domain is $\mathbb{R}$, and for argument's sake let $f$ be as nice as you want. The function $f$ is technically a probability density though. Jan 26, 2023 at 17:37
• ok, then integration by parts is what's happening. They just did it twice to transfer two derivatives away from $f''$ onto $f''$ so that you get $f^{(4)}f$. (recall if things are nice, $\int_{\Bbb{R}}gf'=-\int_{\Bbb{R}}g'f$. Now, do this twice, and you'll see $\int_{\Bbb{R}}gf''=-\int_{\Bbb{R}}g'f'=\int_{\Bbb{R}}g''f$. Now take the special case $g=f''$). Jan 26, 2023 at 17:38
• @peek-a-boo I already have a mental block, so can you please write the detailed solution. Jan 26, 2023 at 17:42
• I just did in my comment above. Ignore the silly $df,df',df''$ notation you've seen. THis is literally basic integration by parts done twice. Jan 26, 2023 at 17:43

Recall if things are nice, then $$\int_{\Bbb{R}}gf'=-\int_{\Bbb{R}}g'f$$. So, doing this twice, we get \begin{align} \int_{\Bbb{R}}gf''=-\int_{\Bbb{R}}g'f'=\int_{\Bbb{R}}g''f. \end{align} Now, take the special case $$g=f''$$ to recover the claimed identity $$\int_{\Bbb{R}}(f'')^2=\int_{\Bbb{R}}f^{(4)}f$$.
• For completeness, in my case $f$ is a probability density. The requirement we impose is that $\lim f^{(3)}(x) = 0$ as $x \to \pm \infty$. Think of the standard normal density, this isn't too far-fetched of a condition to impose. Jan 26, 2023 at 20:55
If we are talking about definite integrals, the equalities are probably held provided that $$f^{\prime \prime}(x) f^{\prime}(x)-f^{\prime \prime \prime}(x) f(x) \textrm{ vanishes for the limits.}$$ If we are talking about definite integrals, using integration by parts, we have the following equalities: \begin{aligned} \int\left(f^{\prime \prime}(x)\right)^2 d x & =\int f^{\prime \prime}(x) d\left(f^{\prime}(x)\right) \\ & =f^{\prime \prime}(x) f^{\prime}(x)-\int f^{\prime}(x) f^{\prime \prime \prime}(x) d x \\ & =f^{\prime \prime}(x) f^{\prime}(x)-\int f^{\prime \prime \prime}(x) d(f(x)) \\ & =f^{\prime \prime}(x) f^{\prime}(x)-f^{\prime \prime \prime}(x) f(x)+\int f^{(4)}(x) f(x)dx \end{aligned}