## Thursday, July 14, 2011

### Note on trig substitution

A fact we needed in a recent post deriving Euler's formula is the value of a particular integral:

 `∫ dx / √(x2 + 1) = ln (x + √(x2 + 1))`

This gave me a lot more trouble than expected, so I thought I'd work through it here for reference. The easiest way is to differentiate the answer. Let:

 `u = x + √(x2 + 1)du = [1 + 2x / 2 √(x2 + 1)] dx = [1 + x / √(x2 + 1)] dxy = ln(u)dy = 1/u du = [1 / (x + √(x2 + 1)) ] [ 1 + x / (√(x2 + 1)] dx`

The trick is to notice that when we find the common denominator for the part at the far right and then add the terms, we generate the denominator of the part to the left.

 `dy = [1 / (x + √(x2 + 1) ] [ (√(x2 + 1) + x) / (√(x2 + 1)] dx = 1 / (√(x2 + 1)`

The integrand is normally written more generally as:

 `∫ 1 / √(x2 + a2)`

and that doesn't change anything.

The forward version starts with a trigonometric substitution.

 `x = a tan yy = tan-1 (x/a)`

Remembering that

 `(u/v)' = (vu' - uv')/v2tan' = (cos2 + sin2)/cos2 = 1/cos2 = sec2`

So

 `dx = a sec2 y dy`

The other part of the integral is:

 `1 / √(x2 + a2)x = a tan yx2 = a2 tan2 yx2 + a2 = a2 tan2 y + a2 = a2 ( 1 + tan2 y)`

 `sin2 y + cos2 y = 1`

and divide by `cos2 y`:

 `tan2 y + 1 = sec2 yx2 = a2 ( 1 + tan2 y) = a2 sec2 y`

Thus the integral reduces to:

 `∫ (a sec2 y) / (a sec y) dy = ∫ sec y dy`

This small integral is itself a bit tricky. The answer, which I found on a really nice site (here), is to multiply top and bottom by:

 ` sec y + tan ysec y ------------- sec y + tan yLet u = sec y + tan y`

If you work through it you'll see that

 `du = (sec y tan y + sec2 y) dy`

Thus, this is

 `∫ du/u = ln(u) = ln (sec y + tan y) = ln [ ((√(x2 + a2) + x ) / a ]`

As I said, not so easy as other trig substitutions.