Help with calculating $(3+5i)^6$ I want to calculate $(3+5i)^6$ with $i = \sqrt{-1}$, but somehow I'm doing something wrong.
How I calculate it:
Say $z = x + yi = 3+5i$, so $z^6$ has to be calculated.
$$|z| = \sqrt{3^2+5^2} = \sqrt{34}$$
$$\text{Arg}(z) = \arctan\left(\frac{y}{x}\right) = \arctan\left(\frac{5}{3}\right)$$
$$z = |z|e^{i\text{Arg}(z)} = \sqrt{34}e^{i\arctan(5/3)}$$
$$z^6 = (\sqrt{34})^6e^{6i\arctan{(5/3)}} =39304e^6e^{i\arctan(5/3)} = 39304e^6(\cos{(\arctan{(5/3)})} + i\sin{(\arctan{(5/3)})}$$
Now to calculate $\cos{(\arctan{(5/3)})}$ and $\sin{(\arctan{(5/3)})}$, I draw a right triangle with an angle $\theta$ and edges that satisfy this.

From this triangle, $$\cos{(\arctan{(5/3)})} = \cos\theta = \frac{3}{\sqrt{34}}$$ and $$\sin{(\arctan{(5/3)})} = \sin\theta = \frac{5}{\sqrt{34}}$$
So $$z^6 = 39304e^6\left(\frac{3}{\sqrt{34}} + i\frac{5}{\sqrt{34}}\right) = \frac{\sqrt{117912e^6}}{\sqrt{34}} + i\times\frac{196520e^6}{\sqrt{34}}$$
When plugged into a calculator (or in this case Julia), this is approximately
julia> 117912e^6/sqrt(34) + im*196520e^6/sqrt(34)
8.158032643069409e6 + 1.3596721071782347e7im

So I get $z^6 \approx 8.16 + 1.36i$. (I'm writing this part because I want to document everything I did, since I don't know what I'm doing wrong.)
However when I calculate $(3 + 5i)^6$ directly, I get
julia> (3 + 5im)^6
39104 - 3960im

So I get $z^6 = 39104 - 3960i$.
What am I doing wrong? Thanks in advance.

Generalize the problem, when $\text{z}\in\mathbb{C}$ and $\text{n}\in\mathbb{R}$:
$$\text{z}^\text{n}=\left(\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i\right)^\text{n}=\left(\left|\text{z}\right|e^{\left(\arg\left(\text{z}\right)+2\pi k\right)i}\right)^\text{n}=\left|\text{z}\right|^\text{n}e^{\text{n}\left(\arg\left(\text{z}\right)+2\pi k\right)i}=$$
$$\left|\text{z}\right|^\text{n}\cos\left(\text{n}\left(\arg\left(\text{z}\right)+2\pi k\right)\right)+\left|\text{z}\right|^\text{n}\sin\left(\text{n}\left(\arg\left(\text{z}\right)+2\pi k\right)\right)i$$
Where $\left|\text{z}\right|=\sqrt{\Re^2\left[\text{z}\right]+\Im^2\left[\text{z}\right]}$, $\arg\left(\text{z}\right)$ is the complex argument of $\text{z}$ and $k\in\mathbb{Z}$.
