Two issues—first, as suggested in Jerry's answer, you have a factor of $|\sec x+\tan x|$ in the numerator of the last term of your derivative that does not belong there. Second, the derivative of $\ln|x|$ is $\frac{1}{x}$ (no absolute value), so $\frac{d}{dx}\ln|f(x)|=\frac{1}{f(x)}\cdot f'(x)$ with the chain rule.