Calculus · Indefinite integrals

Integrating Irrational Functions: The Art of Getting Rid of Roots

Rational functions can always be integrated: decompose into partial fractions, and every piece has a known antiderivative. Roots spoil this. The whole strategy for irrational integrands is one idea, applied in different disguises: find a substitution that makes the root disappear, so that what remains is a rational function. This post goes through the standard cases, explains why each substitution works, and ends with a surprising fact: some innocent-looking integrals cannot be done at all.

1. The guiding idea

Throughout, \(R(x, y)\) denotes a rational function of two variables: an expression built from \(x\), \(y\) and constants using only \(+, -, \times, \div\). For example \( R(x, y) = \frac{x + y^2}{1 - xy} \). An integral such as \( \int R\big(x, \sqrt{x + 1}\big)\,dx \) then means "a rational expression in \(x\) and \(\sqrt{x + 1}\)".

Rationalization We look for a substitution \( x = \varphi(t) \) such that
  • \(x = \varphi(t)\) is a rational function of \(t\) (so \(dx = \varphi'(t)\,dt\) is rational too), and
  • the root also becomes a rational function of \(t\).
Then the integrand becomes rational in \(t\), and partial fractions finish the job. At the end we substitute back \(t = \varphi^{-1}(x)\).

Rational combinations of rational functions are rational, so once both \(x\) and the root are rational in \(t\), everything is. The only question is which substitution achieves that.

2. Roots of linear expressions

Case 1° Integrals of the form \[ \int R\big(x, \sqrt[n]{ax + b}\big)\,dx \qquad\text{and}\qquad \int R\big(x^m, \sqrt[n]{ax^m + b}\big)\,x^{m-1}\,dx \] are reduced to integrals of rational functions by the substitutions \( ax + b = t^n \) and \( ax^m + b = t^n \), respectively.

Why it works. With \( ax + b = t^n \): the root is simply \(t\), and \( x = \frac{t^n - b}{a} \), \( dx = \frac{n t^{n-1}}{a}\,dt \) are polynomials in \(t\). Everything is rational.

The second form is the first one in disguise: put \( u = x^m \), so \( du = m x^{m-1}\,dx \). The factor \(x^{m-1}\,dx\) is exactly what is needed, and the integral becomes \( \frac1m\int R\big(u, \sqrt[n]{au + b}\big)\,du \).

Example 1 \( \displaystyle\int\frac{dx}{1 + \sqrt x} \). Put \( x = t^2 \), \( dx = 2t\,dt \): \[ \int\frac{2t}{1 + t}\,dt = \int\Big(2 - \frac{2}{1 + t}\Big)dt = 2t - 2\ln(1 + t) = 2\sqrt x - 2\ln\big(1 + \sqrt x\big) + C. \]

Several roots at once. If the integrand contains several roots of the same linear expression, say \( \sqrt[k_1]{ax + b}, \sqrt[k_2]{ax + b}, \dots \), use \( ax + b = t^n \) with \(n\) the least common multiple of \(k_1, k_2, \dots\). Then every root is a whole power of \(t\).

Example 2 · Square root and cube root together \( \displaystyle\int\frac{dx}{\sqrt x + \sqrt[3]x} \). The common multiple of \(2\) and \(3\) is \(6\): \( x = t^6 \), \( dx = 6t^5\,dt \), \( \sqrt x = t^3 \), \( \sqrt[3]x = t^2 \). \[ \int\frac{6t^5\,dt}{t^3 + t^2} = 6\int\frac{t^3}{t + 1}\,dt = 6\int\Big(t^2 - t + 1 - \frac{1}{t + 1}\Big)dt. \] So the integral is \( 2\sqrt x - 3\sqrt[3]x + 6\sqrt[6]x - 6\ln\big(1 + \sqrt[6]x\big) + C \).

The same idea works for roots of a linear fraction \( \sqrt[n]{\frac{ax + b}{cx + d}} \): put \( \frac{ax + b}{cx + d} = t^n \), and \(x\) is again rational in \(t\).

3. The substitution \(x - \alpha = 1/t\)

Case 2° The integral \[ \int\frac{Mx + N}{(x - \alpha)^n\sqrt{ax^2 + bx + c}}\,dx \] is computed with the substitution \( x - \alpha = \frac1t \).

Why it works. The troublesome factor \( (x - \alpha)^n \) in the denominator becomes \( t^{-n} \), so it moves to the numerator as \(t^n\). Meanwhile \( ax^2 + bx + c \), written in terms of \(x = \alpha + \frac1t\), becomes \( \frac{(\text{quadratic in } t)}{t^2} \), and its root is \( \frac{\sqrt{\text{quadratic in } t}}{|t|} \). What is left is a polynomial in \(t\) divided by the root of a quadratic in \(t\), which is exactly the type handled in Section 5 below (or, for small \(n\), a basic table integral).

It helps to split the numerator first: \( Mx + N = M(x - \alpha) + (M\alpha + N) \). This gives two integrals of the same type, with powers \(n - 1\) and \(n\).

Example 3 \( \displaystyle\int\frac{dx}{x\sqrt{x^2 - 1}} \) for \(x > 1\). Here \(\alpha = 0\): put \( x = \frac1t \), \( dx = -\frac{dt}{t^2} \), and \( \sqrt{x^2 - 1} = \frac{\sqrt{1 - t^2}}{t} \) (with \(0 < t < 1\)): \[ \int\frac{-dt/t^2}{\frac1t\cdot\frac{\sqrt{1 - t^2}}{t}} = -\int\frac{dt}{\sqrt{1 - t^2}} = -\arcsin t = -\arcsin\frac1x + C. \]

4. Trigonometric substitutions

Case 3° The integrals \[ \int R\big(x, \sqrt{a^2 - x^2}\big)\,dx \qquad\text{and}\qquad \int R\big(x, \sqrt{a^2 + x^2}\big)\,dx \] are reduced to integrals of rational functions of trigonometric functions by the substitutions \( x = a\sin t \) and \( x = a\tan t \), respectively.

Why it works: the Pythagorean identities turn the expression under the root into a perfect square.

\[ a^2 - a^2\sin^2 t = a^2\cos^2 t, \qquad a^2 + a^2\tan^2 t = \frac{a^2}{\cos^2 t}. \]

So \( \sqrt{a^2 - x^2} = a\cos t \) (for \( -\frac\pi2 \le t \le \frac\pi2 \), where \(\cos t \ge 0\)) and \( \sqrt{a^2 + x^2} = \frac{a}{\cos t} \) (for \( |t| < \frac\pi2 \)). The result is an integral of a rational function of \(\sin t\) and \(\cos t\), which can always be done (for instance with \( \tan\frac t2 = u \)).

The third relative, which the original text does not list, is \( \sqrt{x^2 - a^2} \): there the substitution \( x = \frac{a}{\cos t} \) works, because \( \frac{a^2}{\cos^2 t} - a^2 = a^2\tan^2 t \).

t a x √(a² − x²)
Figure 1. The substitution \(x = a\sin t\) read off a right triangle: \( \sin t = \frac xa \), \( \cos t = \frac{\sqrt{a^2 - x^2}}{a} \), \( \tan t = \frac{x}{\sqrt{a^2 - x^2}} \). The triangle is the quickest way to substitute back.
Example 4 · Area under a circle \( \displaystyle\int\sqrt{a^2 - x^2}\,dx \). Put \( x = a\sin t \), \( dx = a\cos t\,dt \): \[ \int a^2\cos^2 t\,dt = \frac{a^2}{2}\Big(t + \sin t\cos t\Big) = \frac{a^2}{2}\arcsin\frac xa + \frac x2\sqrt{a^2 - x^2} + C. \] Taken from \(-a\) to \(a\), this gives \( \frac{\pi a^2}{2} \), the area of a half-disk, as it should.
Example 5 \( \displaystyle\int\frac{dx}{x^2\sqrt{1 + x^2}} \) for \(x > 0\). Put \( x = \tan t \), \( dx = \frac{dt}{\cos^2 t} \), \( \sqrt{1 + x^2} = \frac{1}{\cos t} \): \[ \int\frac{dt/\cos^2 t}{\tan^2 t\,/\cos t} = \int\frac{\cos t}{\sin^2 t}\,dt = -\frac{1}{\sin t} = -\frac{\sqrt{1 + x^2}}{x} + C. \] (From the triangle with legs \(x\) and \(1\): \( \sin t = \frac{x}{\sqrt{1 + x^2}} \).)
General quadratics A root of a general quadratic \( \sqrt{ax^2 + bx + c} \) reduces to one of these three forms by completing the square and shifting: e.g. \( \sqrt{x^2 + 2x + 5} = \sqrt{(x + 1)^2 + 4} \), and \( u = x + 1 \) gives \( \sqrt{u^2 + 2^2} \).

5. Polynomial over \(\sqrt{ax^2 + bx + c}\)

For a polynomial divided by a square root of a quadratic, there is a neat shortcut that avoids trigonometry entirely.

Case 4° · Method of undetermined coefficients With \( Q = \sqrt{ax^2 + bx + c} \) and a polynomial \( P_m(x) = a_0x^m + a_1x^{m-1} + \cdots + a_m \) of degree \(m\): \[ \int\frac{P_m(x)}{Q}\,dx = \big(A_0x^{m-1} + A_1x^{m-2} + \cdots + A_{m-1}\big)\,Q + \lambda\int\frac{dx}{Q}. \] The unknown coefficients \(A_0, \dots, A_{m-1}\) and \(\lambda\) are found by differentiating this equality, multiplying through by \(Q\), and comparing coefficients of equal powers of \(x\) on both sides.

Why this form? The derivative of \( (\text{polynomial of degree } m - 1)\cdot Q \) is \( \frac{\text{polynomial of degree } m}{Q} \), because \( Q' = \frac{2ax + b}{2Q} \). So this term can produce every part of \(P_m/Q\) except one leftover constant over \(Q\), and that is what \(\lambda\int\frac{dx}{Q}\) takes care of. The count also works out: \(m + 1\) unknowns (\(A_0, \dots, A_{m-1}, \lambda\)) for the \(m + 1\) coefficients of \(P_m\).

The remaining integral is a table integral:

\[ \int\frac{dx}{\sqrt{x^2 + k}} = \ln\big|x + \sqrt{x^2 + k}\big| + C, \qquad \int\frac{dx}{\sqrt{a^2 - x^2}} = \arcsin\frac xa + C, \]

after completing the square if needed.

Example 6 \( \displaystyle\int\frac{x^2}{\sqrt{x^2 + 1}}\,dx \). Here \(m = 2\), so we try \[ \int\frac{x^2}{Q}\,dx = (Ax + B)\,Q + \lambda\int\frac{dx}{Q}, \qquad Q = \sqrt{x^2 + 1}. \] Differentiating: \( \frac{x^2}{Q} = A\,Q + (Ax + B)\frac{x}{Q} + \frac{\lambda}{Q} \). Multiplying by \(Q\): \[ x^2 = A(x^2 + 1) + Ax^2 + Bx + \lambda = 2Ax^2 + Bx + (A + \lambda). \] Comparing coefficients: \( 2A = 1 \), \( B = 0 \), \( A + \lambda = 0 \), so \( A = \frac12 \), \( \lambda = -\frac12 \): \[ \int\frac{x^2\,dx}{\sqrt{x^2 + 1}} = \frac x2\sqrt{x^2 + 1} - \frac12\ln\big(x + \sqrt{x^2 + 1}\big) + C. \]

6. Binomial differentials and Chebyshev's theorem

An expression \( x^m(a + bx^n)^p\,dx \), with rational exponents \(m, n, p\), is called a binomial differential. Whether its integral is elementary depends only on these three numbers.

Case 5° · Chebyshev's conditions The integral \( \int x^m(a + bx^n)^p\,dx \) (with \(m, n, p\) rational) can be expressed in elementary functions in the following three cases:
  1. \(p\) is an integer: for \(p \ge 0\), expand \((a + bx^n)^p\) by the binomial theorem; in general (also for \(p < 0\)) substitute \( x = t^N \), where \(N\) is the common denominator of \(m\) and \(n\).
  2. \( \dfrac{m + 1}{n} \) is an integer: substitute \( a + bx^n = t^s \).
  3. \( \dfrac{m + 1}{n} + p \) is an integer: substitute \( ax^{-n} + b = t^s \).
Here \(s\) is the denominator of the fraction \(p\).

Each substitution is designed so that both \(x\) and the power \((a + bx^n)^p\) become rational in \(t\). In case 2, \( (a + bx^n)^p = t^{sp} \) is a whole power of \(t\), and the integer condition makes the remaining factor \(x^m\,dx\) rational as well. Case 3 is case 2 after pulling \(x^n\) out of the bracket: \( (a + bx^n)^p = x^{np}(ax^{-n} + b)^p \).

Example 7 · Case 2 \( \displaystyle\int x^3\sqrt{1 + x^2}\,dx \): \( m = 3, n = 2, p = \frac12 \), and \( \frac{m + 1}{n} = 2 \). Put \( 1 + x^2 = t^2 \), so \( x\,dx = t\,dt \) and \( x^2 = t^2 - 1 \): \[ \int x^2\sqrt{1 + x^2}\;x\,dx = \int(t^2 - 1)\,t\cdot t\,dt = \frac{t^5}{5} - \frac{t^3}{3} = \frac{(1 + x^2)^{5/2}}{5} - \frac{(1 + x^2)^{3/2}}{3} + C. \]
Example 8 · Case 3 \( \displaystyle\int\frac{dx}{x^2(1 + x^2)^{3/2}} \) for \(x > 0\): \( m = -2, n = 2, p = -\frac32 \). Then \( \frac{m + 1}{n} = -\frac12 \) is not an integer, but \( \frac{m + 1}{n} + p = -2 \) is. Put \( x^{-2} + 1 = t^2 \): then \( x^{-3}dx = -t\,dt \) and \( (1 + x^2)^{-3/2} = x^{-3}t^{-3} \), so \[ \int x^{-2}\cdot x^{-3}t^{-3}\,dx = \int(t^2 - 1)\,t^{-3}\,(-t\,dt) = -\int\Big(1 - \frac{1}{t^2}\Big)dt = -t - \frac1t. \] With \( t = \frac{\sqrt{1 + x^2}}{x} \), this simplifies to \( -\dfrac{1 + 2x^2}{x\sqrt{1 + x^2}} + C \).
Chebyshev's theorem: there are no other cases In 1853 Chebyshev proved that if none of the three numbers \( p,\ \frac{m + 1}{n},\ \frac{m + 1}{n} + p \) is an integer, the integral of the binomial differential is not an elementary function. No clever trick will help. For example \[ \int\sqrt{1 + x^3}\,dx \qquad \Big(m = 0,\ n = 3,\ p = \tfrac12:\ \ \tfrac12,\ \tfrac13,\ \tfrac56\ \text{ are not integers}\Big) \] exists (every continuous function has an antiderivative), but it cannot be written with finitely many elementary functions. Such integrals lead to new functions, here elliptic integrals.

7. Summary

Integrand containsSubstitutionWhy it works
\( \sqrt[n]{ax + b} \)\( ax + b = t^n \)root becomes \(t\), \(x\) is a polynomial in \(t\)
several roots \( \sqrt[k_i]{ax + b} \)\( ax + b = t^n \), \(n = \text{lcm}(k_i)\)all roots become powers of \(t\)
\( \frac{1}{(x - \alpha)^n\sqrt{ax^2 + bx + c}} \)\( x - \alpha = \frac1t \)\((x - \alpha)^n\) moves to the numerator
\( \sqrt{a^2 - x^2} \)\( x = a\sin t \)\(1 - \sin^2 = \cos^2\)
\( \sqrt{a^2 + x^2} \)\( x = a\tan t \)\(1 + \tan^2 = 1/\cos^2\)
\( \sqrt{x^2 - a^2} \)\( x = a/\cos t \)\(1/\cos^2 - 1 = \tan^2\)
\( \frac{P_m(x)}{\sqrt{ax^2 + bx + c}} \)undetermined coefficients\( (\deg m{-}1 \text{ poly})\cdot Q \) differentiates to \( \frac{\deg m \text{ poly}}{Q} \)
\( x^m(a + bx^n)^p \)Chebyshev's three casesotherwise not elementary

8. Practice problems

Try each one before opening the solution. More solved problems from this topic are in Integrals.

Problem 1: \( \displaystyle\int\frac{\sqrt x}{1 + x}\,dx \)

\( x = t^2 \): \( \int\frac{2t^2}{1 + t^2}\,dt = \int\Big(2 - \frac{2}{1 + t^2}\Big)dt = 2\sqrt x - 2\arctan\sqrt x + C \).

Problem 2: \( \displaystyle\int\frac{dx}{x^2\sqrt{x^2 - 1}} \) for \(x > 1\)

\( x = \frac1t \): the integral becomes \( -\int\frac{t\,dt}{\sqrt{1 - t^2}} = \sqrt{1 - t^2} = \frac{\sqrt{x^2 - 1}}{x} + C \).

Problem 3: \( \displaystyle\int\sqrt{x^2 + 1}\,dx \) by the method of undetermined coefficients

Write it as \( \int\frac{x^2 + 1}{Q}\,dx = (Ax + B)Q + \lambda\int\frac{dx}{Q} \). Then \( x^2 + 1 = 2Ax^2 + Bx + (A + \lambda) \), so \( A = \frac12, B = 0, \lambda = \frac12 \): \( \frac x2\sqrt{x^2 + 1} + \frac12\ln\big(x + \sqrt{x^2 + 1}\big) + C \).

Problem 4: \( \displaystyle\int\frac{dx}{x\sqrt{1 + x^2}} \) as a binomial differential

\( m = -1, n = 2, p = -\frac12 \); \( \frac{m + 1}{n} = 0 \), case 2. With \( 1 + x^2 = t^2 \): \( \frac{dx}{x} = \frac{x\,dx}{x^2} = \frac{t\,dt}{t^2 - 1} \), so the integral is \( \int\frac{dt}{t^2 - 1} = \frac12\ln\frac{t - 1}{t + 1} = \frac12\ln\frac{\sqrt{1 + x^2} - 1}{\sqrt{1 + x^2} + 1} + C \).

Problem 5: Which of these are elementary? \( \int x^2\sqrt{1 + x^3}\,dx \), \( \int\frac{dx}{\sqrt{1 + x^4}} \), \( \int\sqrt[3]{1 + \sqrt[4]x}\,\frac{dx}{\sqrt x} \)

(a) \( m = 2, n = 3 \): \( \frac{m + 1}{n} = 1 \), elementary; indeed it equals \( \frac29(1 + x^3)^{3/2} + C \).
(b) \( m = 0, n = 4, p = -\frac12 \): \( -\frac12, \frac14, -\frac14 \), none an integer, so not elementary (an elliptic integral).
(c) \( m = -\frac12, n = \frac14, p = \frac13 \): \( \frac{m + 1}{n} = 2 \), elementary, with \( 1 + \sqrt[4]x = t^3 \).

Problem 6: Why does \( x = a\sin t \) require restricting \(t\) to \( [-\frac\pi2, \frac\pi2] \)?

Two reasons: the substitution must be invertible (\( t = \arcsin\frac xa \)), and on that interval \( \cos t \ge 0 \), so \( \sqrt{a^2\cos^2 t} = a\cos t \) without an absolute value.

Final thoughts

Every method in this post follows the same plan: choose a substitution under which the root becomes a rational expression, then integrate a rational function. Linear roots fall to \(ax + b = t^n\); quadratic roots fall to trigonometric identities or to undetermined coefficients; binomial differentials fall to one of Chebyshev's three substitutions. Chebyshev's theorem also marks where the method ends. Beyond those cases there is no substitution to find, and that is a statement about the integral itself, not about how hard we tried.

Related posts: Euler integrals (the gamma and beta functions, which describe many non-elementary integrals) and Taylor's formula.