The definition of the natural log of a complex number: $$\ln(z) = |z| \ + \ i\arg(z)$$
The definition of the natural log: $$\ln(t) = \int_{1}^{t} \frac{1}{x} \ dx$$ for any real $t > 0$.
I actually wanted to derive Euler's formula: $$e^{ix} = \cos(x) + i\sin(x)$$
The procedure is as follows:
$$z(x) = \cos(x) + i\sin(x)$$ $$\frac{\mathrm{d}z}{\mathrm{d}x} = -\sin(x) + i\cos(x) = i(i\sin(x) + \cos(x)) = iz$$ $$\therefore \int \frac{\mathrm{d}z}{z} = \int i \ dx$$ $$ \therefore \ln|z| = ix$$ $$\therefore |z| = e^{ix}$$ $$\therefore z = \pm \ e^{ix} = \cos(x) + i\sin(x)$$
With my limited knowledge that the integral of $1/z$ is always $\ln|z| + C$, I reached a wrong conclusion. However, I could resolve the problem by defining $\ln(z)$ as an indefinite integral of any complex number. But as I mentioned at the top, the definition of the natural log does not involve any complex number. The definition of the natural log with a complex number does not give me such an intuitive way of understanding it.
I am confused with a bunch of things that I can't even say where I'm confused. Can anybody clarify?
Cutting to the chase, I will say: It is not true that $$ \int \frac{1}{z} dz = \ln ( |z|) +C $$ This is true for real numbers, but even there you need to be careful about what you mean, since - for instance - this function is not defined at 0.
Your present path to proving Euler's formula is on the right track, but probably not the easiest path. This is basically due to the fact that $\ln(z)$ is multivalued in the complex case. (This is related to both the complex exponential and the fact that the integral $$ \int_{1}^1 \frac{1}{z} dz$$ is not necessarily $0$, as well as the fact that $e^{2 \pi i} =1 $. These facts are themselves related, and are at the heart of complex analysis.)
An easier way would be: $f(x) = \cos(x) + i \sin(x) $, and $g(x) = e^{ix}$. Then, in case case: $f'(x) = if(x)$ and $g'(x) = ig(x)$. Then, compute: $\left( \frac{f}{g} \right)'(x) = = \frac{ g(x) f'(x) - f(x) g'(x)}{g(x)^2} = \frac{ i (f(x)g(x) - g(x)f(x))}{g(x)^2} = 0$. Last, compute $f(0)$, $g(0)$.