How to know if an integral is well defined regardless of path taken. I can calculate 
\begin{equation*}
\int_0^i ze^{z^2} dz=\frac{1}{2e}-\frac12, 
\end{equation*}
but why can I calculate this irrelevant to the path taken? Is this since it is analytic everywhere - if so, how would I go about verifying this? I can't see how to apply the Cauchy Riemann equations here since I don't know how I would break this into the sum of a real and complex component.
 A: The integrand is  a product of a composition of entire functions. Hence it is analytic everywhere, and in particular analytic on the simply connected domain $\mathbb{C}$. So by Cauchy's integral theorem, for every path $\gamma_1$ in $\mathbb{C}$ from $0$ to $i$, you can create a closed path by completing the path (using any other path $\gamma_2$ from $i$ to $0$), and the integral of that closed path is zero, so what does that say about the integrals along the two paths?
A: Let $f : \mathbb{C} \to \mathbb{C}$ be any complex-valued function over $\mathbb{C}$. let $u, v$ be its real and imaginary part:
$$f(z) = u(z) + i v(z)$$
Let $p, q \in \mathbb{C}$ be any two distinct points and $\gamma : [0,1] \to \mathbb{C}$ be any path in $\mathbb{C}$ joining $p$ to $q$. i.e
$$\gamma(0) = p,\; \gamma(1) = q$$
If one inspect the integral of $f$ over $\gamma$ carefully, one find:
$$\begin{cases}
\Re\left[ \int_{\gamma} f dz \right] &= \int_{\gamma} u dx - v dy\\
\,\,\Im\left[ \int_{\gamma} f dz \right] &= \int_{\gamma} v dx + u dy\\
\end{cases}\tag{*1}$$
If we want the integral $\int_\gamma f dz$ independent of choice of $\gamma$ and depends only on the end points $p, q$, the two line integrals on RHS of $(*1)$ need
to independent of choice of $\gamma$ too. 
Using the Green's theorem, this will happen if 
$$
\begin{cases}
\frac{\partial(-v)}{\partial x} - \frac{\partial u}{\partial y} &= 0\\
\frac{\partial u }{\partial x} - \frac{\partial v}{\partial y} &= 0\\
\end{cases}
\quad\iff\quad
\begin{cases}
\frac{\partial v}{\partial x} + \frac{\partial u}{\partial y} &= 0\\
\frac{\partial u}{\partial x} - \frac{\partial v}{\partial y} &= 0\\
\end{cases}
$$
But the two equations on the right is nothing but the Cauchy-Riemann equations.
So if $f$ is analytic (eg. your $z e^{z^2}$), then by definition it satisfies the
Cauchy-Riemann equations. You can then use Green's theorem to deduce the integral $\int_\gamma f dz$ is independent of path $\gamma$. This is the core of the Cauchy's integral theorem.
Actually, this path independence can be used as an alternate definition of analyticity. Quoting wiki, Morera's theorm states that a continuous, complex-valued function ƒ defined on a connected open set $D \subset \mathbb{C}$ that satisfies 
$$\oint_\gamma f(z)\,dz = 0$$
for every closed piecewise $C^1$ curve $\gamma$ in $D$ must be holomorphic on $D$.
I hope this will clarify the relations among the path independence of $\int_\gamma f dz$, Cauchy Riemann equations, Green's theorem and Cauchy's integral theorem.
A: Going to the Cauchy-Riemann equations is not a good way of showing that $z\mapsto ze^{z^2}$ is differentiable everywhere, just like reasoning explicitly about $\lim_{h\to 0}\frac{f(x+h)+f(x)}{h}$ wouldn't be a good way to investigate whether the real function $x\mapsto xe^{x^2}$ is differentiable everywhere.
Instead note that the symbolic differentiation rules you learned in ordinary real calculus still work in the complex case: The product and sum of differentiable functions are differentiable, the composition of differentiable functions is differentiable, and so forth -- with the expected derivatives! So
$$ \frac{d}{dz} ze^{z^2} = e^{z^2} + z(\frac d{dz}e^{z^2}) = e^{z^2} + z\cdot 2z \cdot e^{z^2} $$
by the product and rule and then the chain rule. Since this computation works for every $z$, the function $ze^{z^2}$ is differentiable everywhere in the complex plane, and thus analytic, so Cauchy's integral theorem applies to it.
