# Integration Tricks

Many challenging integration problems can be solved surprisingly quickly by simply knowing the right technique to apply. While finding the right technique can be a matter of ingenuity, there are a dozen or so techniques that permit a more comprehensive approach to solving definite integrals.

Manipulations of definite integrals may rely upon specific limits for the integral, like with odd and even functions, or they may require directly changing the integrand itself, through some type of substitution. However, most integrals require a combination of techniques, and many of the more complicated approaches, like interpretation as a double integral, require multiple steps to reduce the expression.

Consider, for instance, the antiderivative

\[\displaystyle\int e^{- x^2} \, dx.\]

This is known as the Gaussian integral, after its usage in the Gaussian distribution, and it is well known to have no closed form. However, the improper integral

\[I = \int_0^\infty e^{- x^2} \, dx\]

may be evaluated precisely, using an **integration trick**. In fact, its value is given by the polar integral

\[I^2 = \int_0^\infty \int_0^\infty e^{-x^2} e^{-y^2} \, dy\, dx = \int_0^{\pi/2} \int_0^\infty r e^{-r^2} \, dr\, d\theta.\]

Without such a method for exact evaluation of the integral, the Gaussian (normal) distribution would be significantly more complicated. Such integrals appear throughout physics, statistics, and mathematics.

#### Contents

## Odd and Even Functions

An odd function \(o(x)\) satisfies \(o(x) = - o(-x)\) for all \(x\). Therefore, for any finite \(t\),

\[\int_{-t}^t o(x) \, dx = 0.\]

An even function \(e(x)\) satisfies \(e(x) = e(-x)\) for all \(x\). Therefore, for any \(t\),

\[\int_{-t}^t e(x) \, dx = 2 \int_0^t e(x) \, dx.\]

Evaluate

\[\int_{-1}^1 \frac{x^3-2x}{\sqrt{x^4+1}} \, dx.\]

Notice that the integrand is an odd function. So,

\[\begin{align*} \int_{-1}^1 \frac{x^3-2x}{\sqrt{x^4+1}} \, dx &= \int_{-1}^{1} \frac{(-x)^3-2(-x)}{\sqrt{(-x)^4+1}} \, d(-x) \\ &= - \int_{-1}^1 \frac{x^3-2x}{\sqrt{x^4+1}} \, dx \\ &= \boxed{0}. \end{align*}\]

The final equivalence comes from the fact that the integral is equal to the negative of itself. Therefore, it is \(0\). \(_\square\)

## Reflections

A similar method to the above is to reverse the interval of integration: to "integrate backwards." For a function \(f\) and real numbers \(a < b\),

\[\int_a^b f(x) \, dx = \int_a^b f(a+b-x) \, dx.\]

Instead of the function being centered at \(0\), the function is now centered at \(\tfrac{a+b}{2}\). Then,

\[\int_a^b f(x) \, dx = \frac{1}{2} \int_a^b f(x) + f(a+b-x) \, dx.\]

Evaluate \[ \int_3^7 \frac{\ln(x+2)}{\ln\big(24+10x-x^2\big)} \, dx.\]

We have

\[\begin{align*} \int_3^7 \frac{\ln(x+2)}{\ln\big(24+10x-x^2\big)} \, dx &= \int_3^7 \frac{\ln(x+2)}{\ln(x+2) + \ln(12-x)} \, dx \\\\ &= \frac{1}{2} \int_3^7 \frac{\ln(12-x) + \ln(x+2)}{\ln(x+2) + \ln(12-x)} \, dx \\\\ &= \boxed{2}.\ _\square \end{align*}\]

## Inversions

Suppose the function \(f\) has bounded antiderivative on \([0, \, \infty]\). Then, via the u-substitution \(x \mapsto \tfrac{1}{x}\),

\[\int_0^\infty f(x) \, dx = \frac{1}{2} \int_0^\infty f(x) + \frac{f\big(\frac{1}{x}\big)}{x^2} \, dx.\]

Evaluate

\[ \int_0^\infty \frac{\ln (2x)}{1 + x^2} \, dx.\]

We have

\[ \int_0^\infty \frac{\ln (2x)}{1 + x^2} \, dx = \frac{1}{2} \int_0^\infty \frac{\ln(2x) + \ln\big(2x^{-1}\big)}{1 + x^2} \, dx = \frac{2\ln 2}{2} \int_0^\infty \frac{1}{1 + x^2} \, dx = \boxed{\frac{\pi \ln 2}{2}}.\ _\square\]

## Cyclic Points

This section is currently incomplete. Let's join hands to build this wiki. Feel free to add anything you know about this topic!

There are more transformations than simply reflections and inversions that maintain the interval of integration, but they are not as common.

## Inverse Functions

Suppose the function \(f\) is one-to-one and increasing. Then, a geometric equivalence may be established:

\[\int_a^b f(x) \, dx + \int_{f(a)}^{f(b)} f^{-1}(x) \, dx = bf(b) - af(a).\]

Suppose the function \(f\) is one-to-one and decreasing. Then, another geometric equivalence may be established:

\[\int_a^b f(x) \, dx - \int_{f(b)}^{f(a)} f^{-1}(x) \, dx = (b-a)f(b) - a\big(f(a)-f(b)\big).\]

Let \(f(x)\) be a one-to-one continuous function such that \(f(1)=4\) and \(f(6)=2\), and assume \(\displaystyle \int_1^6 f(x) \, dx = 15\).

Calculate \(\displaystyle \int_2^4 f^{-1}(x) \, dx\).

The region bounded by \(f\), \(x = 1\), and \(y = 2\) must have area \(5\), implying the integral in question corresponds to the area \(5 + 1 \cdot (4 - 2) = \boxed{7}\). The above formula for decreasing functions provides the same answer. \(_\square\)

## Integration by Parts

Integration by parts provides a way to change the integrand directly, and like the exploration of inverse functions, it is a geometric statement. However, this is a statement about the geometry of calculus operators, and any visualization of it would lie in an entirely different space. However, the same intuition can apply. Integration by parts is a very powerful tool, and many problems on this page could be solved by this (and more elementary methods) without the need for anything more complicated.

Integration by parts states that for any differentiable functions \(u(x)\) and \(v(x)\), the following equivalence holds:

\[ \int u(x) v'(x) \, dx = u(x) v(x) - \int v(x) u'(x) \, dx. \]

This can be thought of as a "backwards" application of the product rule.

Evaluate \[\int_1^7 \ln(1 + x) \, dx.\]

Let \(u(x) = \ln(1 + x)\) and \(v(x) = x + 1\). Then, \[\int_1^7 \ln(1 + x) \, dx = \big[(x+1)\ln(x+1)\big]_1^7 - \int_1^7 \frac{x+1}{x+1} \, dx = 8\ln 8 - 2\ln 2 - 6 = \boxed{22 \ln 2 - 6}.\ _\square\]

The (adjusted) beta function \(B(m, \, n)\) is defined for nonnegative integers \(m\) and \(n\) as \[B(m, \, n) = \int_0^1 x^{m}(1-x)^{n} \, dx.\] Find a closed form for \(B(m, \, n)\).

Note that \(B(0, \, n) = \frac{1}{n+1}\). Now, suppose \(n\) is fixed, and note for \(m > 0\), \[\begin{align} B(m, \, n) &= \int_0^1 x^m (1-x)^n \, dx \\ &= 0 - \frac{m}{n+1} \int_0^1 x^{m-1} \cdot \left(-(1-x)^{n+1}\right) \, dx \\ &= \frac{m}{n+1} B(m-1, \, n+1). \end{align}\] Thus, \(B(m, \, n) = \frac{m}{n+1} \cdot \frac{m-1}{n+2} \cdots \frac{1}{n+m} B(0, n+m) = \boxed{\frac{m! n!}{(m+n+1)!}}.\) \(_\square\)

Learn more about the beta function (with correctly off-set indices) here.

## Trigonometric Substitutions

When solving integrals with trigonometric functions, trigonometric identities create shortcuts! The Integration Of Trigonometric Functions wiki goes into this in detail, but below are a few examples.

The first identity is \(\sin^2x+\cos^2x=1.\)

We have

\[\begin{align} \int(\sin x+\cos x)^2\, dx &=\int\left(\sin^2x+2\sin x\cos x+\cos^2x\right)\, dx\\ &=\int(1+\sin 2x)\, dx\\ &=x-\dfrac{1}{2}\cos 2x+C, \end{align}\]

where \(C\) is the constant of integration.

Here is an example of a less obvious application of that identity:

We have

\[\begin{align} \int_0^\frac{\pi}{2}\sin^5x\, dx &=\int_0^\frac{\pi}{2}\sin x\left(1-\cos^2x\right)^2\, dx\\ &=-\int_1^0\left(1-u^2\right)^2\, du\\ &=\int_0^1\left(1-u^2\right)^2\, du\\ &=\frac{8}{15}. \end{align}\]

Other examples that can be used are the double-angle formulas, which can be used in the integrals of \(\sin^2\theta\) and \(\cos^2\theta,\) as well as others.

We have

\[\begin{align} \int\frac{\cos 2x}{\sin x+\cos x}\, dx &=\int\frac{\cos^2x-\sin^2x}{\sin x+\cos x}\, dx\\ &=\int(\cos x-\sin x)\, dx\\ &=\sin x+\cos x+C, \end{align}\] where \(C\) is the constant of integration.

Finally, the product-to-sum identities help to solve complex integrals.

We have

\[\begin{align} \int\sin 2015x \sin 2016x \, dx &=\dfrac{1}{2}\int(\cos x-\cos 4031x)\, dx\\ &=\dfrac{\sin x}{2}-\dfrac{\sin 4031x}{8062}+C, \end{align}\]

where \(C\) is the constant of integration.

## Weierstrass Substitution

One of the most powerful substitutions using trigonometric functions is the Weierstrass substitution of \(t=\tan\frac{\theta}{2}.\) This is most easily seen in rational functions involving trigonometric functions. Through trigonometric identities and manipulation \(\sin\theta=\frac{2t}{1+t^2},\) \(\cos\theta=\frac{1-t^2}{1+t^2},\) and \(d\theta=\frac{2\ dt}{1+t^2}.\) This can often transform the integral into the integral of a rational function, as seen in the following example:

Find the value of \(\displaystyle\int_0^\frac{\pi}{2}\frac{dx}{2+\cos x}.\)

Use the Weierstrass substitution \(\cos x=\dfrac{1-t^2}{1+t^2}\) and \(dx=\dfrac{2dt}{1+t^2}:\)

\[\int_0^\frac{\pi}{2}\frac{dx}{2+\cos x}\ =\int_0^1\frac{\frac{2dt}{1+t^2}}{2+\frac{1-t^2}{1+t^2}}=\int_0^1\frac{2}{t^2+3}dt.\]

This integral can be finished by a \(u\)-substitution and application of the derivative of arctangent. \(_\square\)

The Weierstrass substitution can also be applied to a rather common integral, \(\displaystyle\int\csc x\ dx.\) A common method of solving this question is a "clever" multiplication by \(\frac{1}{1},\) but the Weierstrass substitution is easier to apply.

We have

\[\int\csc \theta\, d\theta=\int\frac{d\theta}{\sin\theta}=\int\frac{\hspace{3mm} \frac{2dt}{1+t^2}\hspace{3mm} }{\frac{2t}{1+t^2}}=\int\frac{dt}{t}=\ln t+C,\]

where \(C\) is the constant of integration.

All that's needed is to re-substitute \(t=\tan\frac{\theta}{2}\) to obtain the final value of

\[\ln\left(\tan\frac{\theta}{2}\right)+C=-\ln(\cot x+\csc x)+C=\ln\frac{\sin\theta}{\cos\theta+1}+C.\]

A final use of the Weierstrass substitution is the "reverse Weierstrass substitution," which involves simplifying the integral of a rational function with trigonometry.

Find the value of \(\displaystyle\int_0^1\dfrac{\arcsin\frac{2x}{1+x^2}}{1+x^2}\, dx\).

Recall that in the Weierstrass substitution, \(\frac{2x}{1+x^2}=\sin\theta\) and \(\frac{2dx}{1+x^2}=d\theta.\) Then the above can be transformed to

\[\displaystyle\int_0^\frac{\pi}{2}\frac{\sin^{-1}(\sin\theta)}{2}\, d\theta=\displaystyle\int_0^\frac{\pi}{2}\frac{\theta}{2}\, d\theta.\]

This is the integral of a polynomial, which evaluates to \(\frac{\pi^2}{16}.\) \(_\square\)

## Taylor Series

Some functions like \(\tfrac{1}{1-x}\), \(\ln(1 - x)\), \(\arctan x\), and \(e^x\) have nice Taylor expansions that, together with term-by-term integration, can lead to a closed-form answer. The monotone convergence theorem states that in most cases where the integral does exist (as should generally be the case when evaluating an integral), the summation and integral may be interchanged. For more information, see Double Integrals.

Evaluate

\[ \int_0^1 \ln x \ln(1 - x) \, dx.\]

Note

\[ \int_0^1 \ln x \ln(1-x) \, dx = - \int_0^1 \sum_{k = 1}^\infty \frac{x^k \ln x}{k} \, dx.\]

Since the monotone convergence theorem applies here, this is equal to

\[\begin{align} - \sum_{k = 1}^\infty \int_0^1 \frac{x^k \ln x}{k} \, dx &= \sum_{k = 1}^\infty \frac{1}{k (k+1)^2} \\ &= \sum_{k = 1}^\infty \frac{1}{k(k + 1)} - \sum_{k = 1}^\infty \frac{1}{(k + 1)^2} \\ &= \boxed{2 - \frac{\pi^2}{6}}.\ _\square \end{align}\]

## Differentiation Under the Integral Sign

Main article: Differentiation under the integral sign

Differentiating under the integral sign is a useful method for evaluating certain integrals which might be harder using other methods. This method of integrating was so frequently used by Richard Feynman that it is often referred to as **Feynman's integration trick**.

\[\dfrac{d}{dx} \displaystyle \int_{g(x)}^{h(x)} f(x,t)dt = f\big(x,h(x)\big)\dfrac{d}{dx}h(x) - f\big(x,g(x)\big)\dfrac{d}{dx}g(x) + \displaystyle \int_{g(x)}^{h(x)}\dfrac{\partial}{\partial x}f(x,t)dt. \ _\square \]

Compute \[ \displaystyle \int_{0}^{\infty} \dfrac{e^{-5x} - e^{-7x}}{x} \, dx. \]

Let \( I(a) = \displaystyle \int_{0}^{\infty} \dfrac{e^{-5x} - e^{-ax}}{x}\, dx.\) Upon differentiating under the integral sign, the equation becomes \[\begin{align} \dfrac{\partial I}{\partial a} &= \displaystyle \int_{0}^{\infty} \dfrac{\partial }{\partial a}\dfrac{e^{-5x} - e^{-ax}}{x}\, dx \\ &= \displaystyle \int_{0}^{\infty} \dfrac{0 -(-xe^{-ax})}{x}\, dx \\ &= \displaystyle \int_{0}^{\infty} e^{-ax}\, dx. \end{align}\] Now, integrating with respect to \(x\) yields the following:

\[ \dfrac{\partial I}{\partial a} = \left[\dfrac{e^{-ax}}{a}\right]_{\infty}^{0} \Rightarrow \dfrac{\partial I}{\partial a} = \dfrac{1}{a} .\] Integrating both sides with respect to \(a,\)

\[ I(a) = \displaystyle \int \dfrac{1}{a}\, da + C \Rightarrow I(a) = \ln a + C, \qquad (1) \] where \(C\) is the constant of integration.Notice that \( I(5) = \displaystyle \int_{0}^{\infty} \dfrac{e^{-5x} - e^{-5x}}{x}\, dx = \int_{0}^{\infty} 0\, dx = 0. \)

Substituting these values in \((1)\) gives \[ 0 = \ln 5 + C \Rightarrow C = -\ln 5 \Rightarrow I(a) = \ln\dfrac{a}{5}.\] To obtain the required integral, substitute \(a = 7\): \[ I(7) = \ln\dfrac{7}{5} \implies \displaystyle \int_{0}^{\infty} \dfrac{e^{-5x} - e^{-7x}}{x}\, dx = \ln\dfrac{7}{5}. \ _\square\]

Compute \[ \displaystyle \int_{0}^{\infty} \dfrac{\sin x}{x}\, dx. \]

Let \( I(a) = \displaystyle \int_{0}^{\infty} e^{-ax}\dfrac{\sin x}{x}\, dx. \) Then differentiating under the integral sign gives

\[ \dfrac{\partial I(a)}{\partial a} = \displaystyle \int_{0}^{\infty} \dfrac{\partial}{\partial a} e^{-ax}\dfrac{\sin x}{x}\, dx= -\displaystyle \int_{0}^{\infty} e^{-ax}\sin x\, dx. \] Integrating with respect to \(x,\) \[ \dfrac{\partial I(a)}{\partial a} = \left[\dfrac{e^{-ax}\left(a\sin x + \cos x\right)}{a^{2}+1}\right]_{0}^{\infty} = -\dfrac{1}{1+a^{2}}. \] Integrating with respect to \(a,\)

\[ I(a) = \displaystyle \int -\dfrac{1}{1+a^{2}} = -\tan^{-1} a + C, \] where \(C\) is the constant of integration. Now, \[ \displaystyle \lim_{a\rightarrow \infty} = \displaystyle \int_{0}^{\infty} \displaystyle \lim_{a\rightarrow \infty} e^{-ax}\dfrac{\sin x}{x}dx = 0 .\] Using the above information,

\[ 0 = -\displaystyle \lim_{a \rightarrow \infty} \tan^{-1} a + C \Rightarrow C = \dfrac{\pi}{2} \Rightarrow I(a) = \dfrac{\pi}{2} - \tan^{-1} a. \] To get our integral, we let \(a = 0\) to obtain \[ I(0) = \dfrac{\pi}{2} - \tan^{-1} 0 = \dfrac{\pi}{2}. \]Therefore, \( \displaystyle \int_{0}^{\infty} \dfrac{\sin x}{x}\, dx = \dfrac{\pi}{2} . \ _\square\)

## Changing to a Double Integral

Sometimes, the integrand looks like it has already been integrated. This may signal that the integral is better interpreted as a double integral. There are more possibilities for \(u\)-substitutions when two variables can be manipulated (polar, skewed, etc), and simply changing the order of integration may suffice to simplify the integral.

In many ways, this is a dual method to differentiation under the integral sign. The main difference is that the extra variable is interpreted *inside* of the variable rather than outside of it. In most cases where one works, both could work; in some cases, only one approach works nicely, so it is good to know both.

Suppose \(a < b\) are real numbers, \(f\) a function, and \(I = \int_a^b f(x) \, dx.\)

If \(f(x) = G_x(t) - G_x(s)\) for some constants \(s < t\), then \[I = \int_a^b \int_s^t f(x) G_x'(y) \, dy \, dx.\]

Supposing Fubini's theorem holds, the order of integration may be swapped or otherwise altered.

Evaluate

\[\int_0^{\infty} \frac{e^{\pi x} - e^{x}}{x(e^{\pi x}+1)(e^{x}+1)} \, dx.\]

We have

\[ \begin{align*} \int_0^{\infty} \frac{e^{\pi x} - e^{x}}{x(e^{\pi x}+1)(e^{x}+1)} \, dx &= \int_0^\infty \frac{1}{x (e^x + 1)} - \frac{1}{x (e^{\pi x} + 1)} \, dx \\ &= \int_0^\infty \int_1^\pi \frac{e^{tx}}{(e^{tx} + 1)^2} \, dt \, dx \\ &= \int_1^\pi \int_0^\infty \frac{e^{tx}}{(e^{tx} + 1)^2} \, dx \, dt \\ &= \int_1^\pi \left[ - \frac{1}{t (e^{tx} + 1)} \right]_0^\infty \, dt \\ &= \int_1^\pi \frac{1}{(1 + 1)t} \, dt \\ &= \boxed{\frac{\ln \pi}{2}}.\ _\square \end{align*} \]

## Harmonic Functions

In complex analysis, a harmonic function is a real-valued function that is the real or imaginary part of a complex-differentiable function. In multivariable calculus, it is a function \(f(x, \, y)\) such that \(\left(\frac{\partial}{\partial x}\right)^2 f + \left( \frac{\partial}{\partial y}\right)^2f = 0.\) Generally, such facts from fields afar are not applicable to the evaluation of real integrals; however, the harmonic functions have a special property that greatly simplifies integration over circles.

Suppose \(f\) is a bivariate harmonic function, \((a, \, b)\) is a point in the plane, and \(r\) is a positive real number. Then,

\[ \int_0^{2\pi} f(a + r\cos\theta, \, b + r\sin\theta) \, d\theta = 2\pi f(a, \, b).\]

Evaluate \[\int_0^{2\pi} e^{\cos x} \cos(\sin x) \, dx.\]

Consider the function \(f(x, \, y) = e^x \cos y.\) Note that

\[ \left(\frac{\partial}{\partial x}\right)^2 f + \left(\frac{\partial}{\partial y}\right)^2 f = e^x \cos y + e^x (- \cos y) = 0.\]

Therefore, \(f\) is a harmonic function, and it follows that

\[\int_0^{2\pi} e^{\cos x} \cos(\sin x) \, dx = 2\pi e^0 \cos(0) = \boxed{2\pi}.\ _\square\]

**Cite as:**Integration Tricks.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/integration-tricks/