Aid in identifying an error made whilst evaluating an integral 
Evaluate $$I=\int\frac{1}{x^2-8x+8}~dx$$

First, complete the square using the denominator: $$x^2-8x+8=(x-4)^2-8$$
and therefore, let $x=2\sqrt{2}\sec{\theta}+4$, $\therefore dx=2\sqrt{2}\sec{\theta}\tan{\theta}~d\theta$, and hence, we have
$$I=2\sqrt{2}\int\frac{\sec{\theta}\tan{\theta}}{(2\sqrt{2}\sec{\theta}+4-4)^2-8}~d\theta$$ $$=2\sqrt{2}\int\frac{\sec{\theta}\tan{\theta}}{(2\sqrt{2}\sec{\theta})^2-8}~d\theta$$
$$=2\sqrt{2}\int\frac{\sec{\theta}\tan{\theta}}{8\sec^2{\theta}-8}~d\theta$$
$$=\frac{\sqrt{2}}{4}\int\frac{\sec{\theta}\tan{\theta}}{\sec^2\theta-1}~d\theta$$
$$=\frac{\sqrt{2}}{4}\int\frac{\sec{\theta}\tan{\theta}}{\tan^2\theta}~d\theta$$
$$=\frac{\sqrt{2}}{4}\int\frac{\sec{\theta}}{\tan\theta}~d\theta$$
note:$$\frac{\sec{\theta}}{\tan{\theta}}=\frac{\cos{\theta}}{\sin{\theta}}\cdot\frac{1}{\cos{\theta}}=\csc{\theta}$$
therefore,
$$I=-\frac{\sqrt{2}}{4}\ln{|\csc\theta+\cot\theta|}+C$$
now, using the fact that $x=2\sqrt{2}\sec\theta+4$, we have the following identities, based on the definition of the trigonometric functions:
$$\csc\theta=\frac{x-4}{\sqrt{x^2-8x+8}}$$
as well as
$$\cot\theta=\frac{2\sqrt{2}}{\sqrt{x^2-8x+8}}$$
therefore, the final integral is given by:
$$I=-\frac{\sqrt{2}}{4}\ln{\left|\frac{x+2\sqrt{2}-4}{\sqrt{x^2-8x+8}}\right|}+C$$
which, I've been informed, is incorrect. Would anyone be kind enough to help me realize my error? Any responses are appreciated. Thank you.

Your answer is correct and it's only a matter of rewriting.
Let us consider your integral:
$$I=\int\frac{1}{x^2-8x+8}\ dx.$$
I approached this problem by factoring the denominator instead of completing the square:
$$x^2-8x+8=0.$$
The discriminant is given by $\Delta_x=(-8)^2-4(1)(8)=64-32=32$ such that $\sqrt{\Delta_x}=\sqrt{32}=4\sqrt{2}$.
Solutions for $x$ are given by $$x_{1,2}=\frac{-(-8)\pm4\sqrt{2}}{2(1)}=4\pm2\sqrt{2}.$$ 
Thus,
$$x^2-8x+8=(x-4-2\sqrt{2})(x-4+2\sqrt{2}).$$
Next I applied partial fraction decomposition on the integrand:
$$\frac{1}{x^2-8x+8}=\frac{A}{x-4-2\sqrt{2}}+\frac{B}{x-4+2\sqrt{2}}.$$
It follows that
$$1=A(x-4+2\sqrt{2})+B(x-4-2\sqrt{2})=(A+B)(x-4)+(A-B)2\sqrt{2}.$$
It can be derived that $A+B=0$ and $(A-B)2\sqrt{2}=1$ which means that $A=\frac{1}{4\sqrt{2}}$ and $B=-\frac{1}{4\sqrt{2}}$. 
Thus,
$$\frac{1}{x^2-8x+8}=\frac{1}{4\sqrt{2}}\left(\frac{1}{x-4-2\sqrt{2}}-\frac{1}{x-4+2\sqrt{2}}\right).$$
Substitution into your integral gives
$$I=\frac{1}{4\sqrt{2}}\int\left(\frac{1}{x-4-2\sqrt{2}}-\frac{1}{x-4+2\sqrt{2}}\right) dx.$$
Integration yields
$$I=\frac{1}{4\sqrt{2}}\ln\left|\frac{x-4-2\sqrt{2}}{x-4+2\sqrt{2}}\right|+\text{constant}.$$
Okay, so we have arrived at an expression. Let us rewrite it to yield your expression.
Consider
$$I=-\frac{1}{4\sqrt{2}}\ln\left|\left(\frac{x-4-2\sqrt{2}}{x-4+2\sqrt{2}}\right)^{-1}\right|+\text{constant}.$$
It follows that
$$I=-\frac{1}{4\sqrt{2}}\ln\left|\frac{x-4+2\sqrt{2}}{x-4-2\sqrt{2}}\right|+\text{constant}.$$
Within the argument of the natural logarithm; multiply both the denominator and numerator by $x-4+2\sqrt{2}$:
$$I=-\frac{1}{4\sqrt{2}}\ln\left|\frac{x-4+2\sqrt{2}}{x-4-2\sqrt{2}}\frac{x-4+2\sqrt{2}}{x-4+2\sqrt{2}}\right|+\text{constant}.$$
It follows that
$$I=-\frac{1}{4\sqrt{2}}\ln\left|\frac{(x-4+2\sqrt{2})^2}{x^2-8x+8}\right|+\text{constant}.$$
Write $\frac{1}{\sqrt{2}}=\frac{\sqrt{2}}{2}$:
$$I=-\frac{\sqrt{2}}{4}\frac{1}{2}\ln\left|\frac{(x-4+2\sqrt{2})^2}{x^2-8x+8}\right|+\text{constant}.$$
It follows that
$$I=-\frac{\sqrt{2}}{4}\ln\left|\frac{x-4+2\sqrt{2}}{\sqrt{x^2-8x+8}}\right|+\text{constant}.$$
We have obtained your expression.
