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.
First of all consider the derivations of the inverse hyperbolic functions as follows
These can be found by using the identity $x'(y)=\frac1{y'(x)}$ and some knowledge concerning the hyperbolic functions. Integrating these equations leads to some nice formulas for integrating fractions of the form $x^2-1$ and $1-x^2$. With these tools one can avoid using a trigonometric subsitution here.
Especially for your integral we get
$$\begin{align} \int\frac1{x^2-8x+8}dx&=\int\frac1{(x-4)^2-8}dx\\ &=\frac18\int\frac1{\left(\frac{x-4}{2\sqrt{2}}\right)^2-1}dx\\ &=\frac18\int\frac1{u^2-1}du\\ &=-\frac18\operatorname{artanh}(u)+C\\ &=-\frac18\operatorname{artanh}\left(\frac{x-4}{2\sqrt{2}}\right)+C \end{align}$$
The only thing you have to care about is when to use the inverse hyperbolic tangent and when to use the inverse hyperbolic cotangent.
By using the definitions of the hyperbolic functions
$$\tanh(x)=\frac{e^x-e^{-x}}{e^x+e^{-x}}~~~\coth(x)=\frac{e^x+e^{-x}}{e^x-e^{-x}}$$
we can verify the following formulas for the inverse functions
which can be used to reshape the solution of the integral in terms of the natural logarthim.