# How do you integrate int x / sqrt(-x^2+8x-32) dx using trigonometric substitution?

$- 4 i \cdot \ln \left(\frac{x - 4 + \sqrt{{x}^{2} - 8 x + 32}}{4}\right) - i \cdot \sqrt{{x}^{2} - 8 x + 32}$ where $i = \sqrt{- 1}$

#### Explanation:

The solution is really quite long but there is a solution;
with acute angle $\theta$
side opposite to angle $\theta$ = (x-4)
side opposite to 90 degree angle= $\sqrt{{x}^{2} - 8 x + 32}$
side adjacent to $\theta$ = 4

Our trigonometric substitution goes like this:
Let $x - 4 = 4 \cdot \tan \theta$

and $x = 4 + 4 \cdot \tan \theta$

also ${\left(x - 4\right)}^{2} = 16 \cdot {\tan}^{2} \theta$

$\mathrm{dx} = 4 \cdot {\sec}^{2} \theta$ $d$$\theta$

and $\tan \theta = \frac{x - 4}{4}$

our $\sec \theta = \frac{\sqrt{{x}^{2} - 8 x + 32}}{4}$

Take note that $\sqrt{{x}^{2} - 8 x + 32} = \sqrt{{\left(x - 4\right)}^{2} + 16}$

from the given:
$\int \frac{x}{\sqrt{- {x}^{2} + 8 x - 32}} \mathrm{dx}$

$\int \frac{x}{\sqrt{- \left({x}^{2} - 8 x + 16 + 16\right)}} \mathrm{dx}$

$\int \frac{x}{\sqrt{- \left({\left(x - 4\right)}^{2} + 16\right)}} \mathrm{dx}$

from the above it follows

int ((4+4*tan theta) * 4 sec^2 theta )/sqrt(-1(16*tan^2 theta+16) $d$$\theta$

$\int \frac{4 \left(1 + \tan \theta\right) \cdot 4 {\sec}^{2} \theta}{\sqrt{- 1} \cdot \sqrt{16 \cdot {\tan}^{2} \theta + 16}}$ $d$$\theta$

$\int \frac{4 \left(1 + \tan \theta\right) \cdot 4 {\sec}^{2} \theta}{\sqrt{- 1} \cdot \sqrt{16} \cdot \sqrt{{\tan}^{2} \theta + 1}}$ $d$$\theta$

$\int \frac{4 \left(1 + \tan \theta\right) \cdot {\sec}^{2} \theta}{\sqrt{- 1} \cdot \sqrt{{\tan}^{2} \theta + 1}}$ $d$$\theta$

but $\sqrt{{\tan}^{2} \theta + 1} = \sec \theta$

$\int \frac{4 \left(1 + \tan \theta\right) \cdot {\sec}^{2} \theta}{\sqrt{- 1} \cdot \sec \theta}$ $d$$\theta$

then $\int \frac{4 \left(1 + \tan \theta\right) \cdot \sec \theta}{\sqrt{- 1}}$ $d$$\theta$

it follows $\int \frac{4 \left(\sec \theta + \tan \theta \sec \theta\right)}{\sqrt{- 1}}$ $d$$\theta$

and $\left(\frac{4}{\sqrt{- 1}}\right) \int \sec \theta$ $d$$\theta$ + $\left(\frac{4}{\sqrt{- 1}}\right) \int \tan \theta \sec \theta$ $d$$\theta$

but $\sqrt{- 1} = i$ and ${i}^{2} = - 1$

$\left(\frac{4}{\sqrt{- 1}} \cdot \frac{\sqrt{- 1}}{\sqrt{- 1}}\right) \int \sec \theta$ $d$$\theta$ + $\left(\frac{4}{\sqrt{- 1}} \cdot \frac{\sqrt{- 1}}{\sqrt{- 1}}\right) \int \tan \theta \sec \theta$ $d$$\theta$

$\left(\frac{4 i}{- 1}\right) \int \sec \theta$ $d$$\theta$ + $\left(\frac{4 i}{- 1}\right) \int \tan \theta \sec \theta$ $d$$\theta$

after integration using the basic formulas

$\left(\frac{4 i}{-} 1\right) \ln \left(\sec \theta + \tan \theta\right)$ + $\left(\frac{4 i}{-} 1\right) \sec \theta$

returning to our original variables and simplifying, it follows,

$- 4 i \cdot \ln \left(\frac{x - 4 + \sqrt{{x}^{2} - 8 x + 32}}{4}\right) - i \cdot \sqrt{{x}^{2} - 8 x + 32}$