How to integrate $\cos(z)~dz$? How to find: $$\int\cos(z)~dz$$ where $z$ is complex? I know the result is $\sin(z)+C$ but I don't understand why I think I'mgetting confused on how we calculate the complex integrals can someone help explain?
Firstly, since your integral has no bounds, what the symbol &quot;$\int f(z) \ dz$&quot; represents is the antiderivative of $f(z)$, meaning,  it's the family of functions that when differentiated result in $f(z)$. So now the question becomes &quot;How do we define derivatives for complex functions?&quot;.
As you can see in this answer, the derivative definition for complex functions is analogous to the derivative for real functions as it's given by
$$
f'(z) =\lim_{h \to 0} \frac{f(z+h) - f(z)}{h}
$$
Notice that because we use the same derivative definition as we do for real functions, it makes sense for a complex function to have the same derivative as its real counterpart.
Another question that might cause trouble is &quot;How do we make sense of $\sin(z)$ and $\cos(z)$ when $z$ is complex?&quot;. We know that for real numbers a basic definition of the trig functions can be given as the $x$ and $y$ coordinates on points of a circle, but this doesn't make sense when the input is complex. So what do we do? Well, we remember that for real values we can express these trig functions as Taylor series given by
$$
\sin (x) = \sum^{\infty}_{n=0} \frac{(-1)^n}{(2n+1)!} x^{2n+1}  \qquad \cos (x) = \sum^{\infty}_{n=0} \frac{(-1)^n}{(2n)!} x^{2n}
$$
The important thing to notice is that if we substitute $x$ for a complex number $z$ in the above equations we can make sense of $\sin(z)$ and $\cos(z)$ because in the series part we would just be multiplying and then adding complex numbers,  which are both things we do know how to do! Using this definition combined with the definition of the derivative established earlier, you can show that for complex numbers it is also true that
$$
\frac{d}{dz} \sin(z) + C = \cos(z)
$$

The tl;dr version of the answer is that the antiderivative is the same as for real-valued functions because the complex definition for derivatives is designed to be a natural extension of the real derivative, and so, the behavior of the derivatives of the real function and its complex counterpart are analogous.
Lastly, if the concept of adding up &quot;infinitely many complex numbers&quot; by defining sine and cosine in terms of infinite series sounds a bit weird, I recommend watching this video by 3Blue1Brown that has some very nice explanations and visualizations on that very subject.
$z=\theta$ which is just an angle so whether it is real or complex its integration would be $\sin(z)+c$ also all real numbers are subset of complex numbers or as we are used to x replace $z=x$