Trig Substitution Calculator

Type an integrand with a square root of a quadratic to substitute for x.

Use x. Type powers with ^, and functions with brackets: sin(x), e^(2x), ln(x), sqrt(x).

Try

Result

You entered∫1x2+4 dx\int \frac{1}{x^{2} + 4}\,dx

∫1x2+4 dx=arctan⁡(x2)2+C\displaystyle \int \frac{1}{x^{2} + 4}\,dx = \frac{\arctan\left(\frac{x}{2}\right)}{2} + C
Show the work
  1. Trigonometric substitution

    The integrand contains an a2+x2a^2 + x^2 form, so let x=atan⁡θx = a\tan\theta: then a2+x2=a2sec⁡2θa^2 + x^2 = a^2\sec^2\theta.

    x=2tan⁡θdx=2sec⁡2θ dθx2+4=4sec⁡2θ\begin{gathered} x = 2\tan\theta \\ dx = 2\sec^{2} \theta\,d\theta \\ x^{2} + 4 = 4\sec^{2} \theta \end{gathered}
  2. Rewrite in theta

    Replace every x, the root and dx, then simplify.

    ∫1x2+4 dx=∫12 dθ\int \frac{1}{x^{2} + 4}\,dx = \int \frac{1}{2}\,d\theta
  3. Constant rule

    The integrand does not contain θ\theta, so it is a constant.

    Using ∫c dx=cx+C\int c\,dx = cx + C

    ∫12 dθ=θ2\int \frac{1}{2}\,d\theta = \frac{\theta}{2}
  4. Back-substitute with the triangle

    Draw a right triangle with opposite side xx, adjacent side 22 and hypotenuse x2+4\sqrt{x^{2} + 4}.

    θ2  →  arctan⁡(x2)2\frac{\theta}{2} \;\to\; \frac{\arctan\left(\frac{x}{2}\right)}{2}
  5. Result

    An antiderivative is only defined up to a constant, so the constant of integration CC is added.

    ∫1x2+4 dx=arctan⁡(x2)2+C\int \frac{1}{x^{2} + 4}\,dx = \frac{\arctan\left(\frac{x}{2}\right)}{2} + C

Worked examples