I took two approaches for $\tanh(x) $
using $\int tanh (x) dx $ = $\int \frac {sinh x}{cosh x} dx $ , making a u-substitution with $\cosh(x) $ to reach $\ln|cosh(x)| + K$ which is what I found when I looked it up.
using the exponential definition : $\tanh(x) = \frac {e^{x}-e^{-x}}{e^{x}+e^{-x}} $ I did a u-substitution again with the denomerator and reached : $\ ln |(e^{x}+e^{-x})| $
which is only a factor of $ \frac {1}{2} $ away from the first one. what would be the mistake here ?
You haven't made a mistake -the two answers are equivalent as they only differ by the arbritary constant:
$$\ln|e^{x}+e^{-x}|+c= \ln\frac{1}{2}+\ln|e^{x}+e^{-x}| + c - \ln\frac{1}{2}$$
$$= \ln|\frac{1}{2}\cdot(e^{x}+e^{-x})| + c' = \ln|\cosh x| + c'$$
where $c' = c-\ln \frac{1}{2}$