# How to find real and imaginary parts of complex function

I am trying to find the real and imaginary parts of $$f(z)=z^2\cos z-e^{z^3-z}$$ AND directly verify that both are harmonic

and am having lots of trouble. I know f is holomorphic, and I know many identies such as $$\cos(z)=\cos(x)\cosh(y)-i\sin(x)\sinh(y)$$

but no matter how I try to reorganize, I get so many terms all containing different parts and then I am unable to proceed because I am confused. Is this the only way to find the real and imaginary parts? can anyone give advice/help for this?

Update: I have now gotten $$Re(f(z))=x^2cosxcoshy+2xysinxsinhy-y^2cosxcoshy-e^{x^3-3xy^2-x}cos(3x^{2}y-y^3-y)$$

and

$$Im(f(z))=(-x^2sinxsinhy+2xycosxcoshy+y^2sinxsinhy)-e^{x^3-3xy^2-x}sin(3x^{2}y-y^3-y)$$

but when it comes to verifying harmonic I know I am supposed to check second partial deravatives, but I am having lots of trouble even calculating the first as I am getting so many terms

## 4 Answers

If you want ALL the calculation (Robert's answer might be ways better, though) here they are:

$$z = x + iy$$

$$z^2 = (x+iy)(x+iy) = x^2 - y^2 + 2ixy$$

$$\cos(z) = \cos(x + iy) = \cos(x)\cos(iy) - \sin(x)\sin(iy) = \cos(x)\cosh(y) - \sin(x)i\sinh(y)$$

$$z^2\cos(z) = (x^2 - y^2 + 2ixy)(\cos(x)\cosh(y) - \sin(x)i\sinh(y)) = [(x^2-y^2)\cos(x)\cosh(y) +2xy\sin(x)\sinh(y)] + i[2xy\cos(x)\cosh(y) + (x^2-y^2)\sin(x)\sinh(y))$$

$$z^3 = z\cdot z^2 = (x+iy)(x^2 - y^2 + 2ixy) = x^3 - xy^2 + 2ix^2y + iyx^2 - iy^3 - 2xy^3 = x^3 - xy^2 - 2xy^3 + i(2x^2y + yx^2 - y^3)$$

$$z^3 - z = x^3 - xy^2 - 2xy^3 + i(2x^2y + yx^2 - y^3) - (x+iy) = x^3 - xy^2 - 2xy^3 -x + i(2x^2y + yx^2 - y^3 - y)$$

$$e^{z^3-z} = e^{x^3 - xy^2 - 2xy^3}\cdot e^{i(2x^2y + yx^2 - y^3)}$$

Now you should be able to separate the real part from the imaginary part! It's very straightforward!

• This is why I don't brute force my way through these problems XD – Simply Beautiful Art Sep 28 '16 at 21:43
• thanks but I managed that part, but now it asks to verify directly that both parts are harmonic and I am getting massive equations, is that normal – PersonaA Sep 28 '16 at 21:44
• @SimpleArt ahah lol! xD – Von Neumann Sep 28 '16 at 22:15
• @PersonaA Given the amount of terms, it's normal. But I'm sure that you will come to some simplifications, once you managed to write down the whole equation. If you have some troubles, consider to ask it in a new question! – Von Neumann Sep 28 '16 at 22:16

For the first part, $z^2 = (x^2 - y^2) + 2 i x y$ and $\cos(z)$ is as you say. Multiply these term-by-term and select the parts without and with $i$.

For the second part, write $z^3 - z = x^3 - 3 xy^2 - x + i (3x^2y - y^3 - y) = u + i v$. Then $e^{u+iv} = e^u \cos(v) + i e^u \sin(v)$.

Then put the two parts together. $\text{Re}(A-B) = \text{Re}(A) - \text{Re}(B)$, and similarly for $\text{Im}$.

• Thanks, really helped. I am very stuck on directly verifying harmonic though. My apologies, this is my first course in complex variables. – PersonaA Sep 28 '16 at 21:53
• because it says to verify directly, but I am having doubts that are professor really wants us to spend 10 pages on checking deravatives, so I think I must be missing something – PersonaA Sep 28 '16 at 23:08
• That verification is somewhat complicated, but $10$ pages is maybe a bit of an overstatement, depending on how you write it. For the real part I end up with $3$ terms: $$\left( {x}^{2}-{y}^{2} \right) \cos \left( x \right) \cosh \left( y \right) +2\,xy\sin \left( x \right) \sinh \left( y \right) -{{\rm e}^ {{x}^{3}-3\,x{y}^{2}-x}}\cos \left( 3\,{x}^{2}y-{y}^{3}-y \right)$$ The second derivatives with respect to $x$ and with respect to $y$ each have $10$ terms (one being the negative of the other, of course). – Robert Israel Sep 28 '16 at 23:50
• It's fairly likely that your instructor (presumably not a sadist) didn't actually write these all out by hand before assigning the problem, and so didn't realize how much (rather pointless) computation it involved. – Robert Israel Sep 29 '16 at 0:00

HINT for finding $\Re\left[f(\text{z})\right]$ and $\Im\left[f(\text{z})\right]$: $$f(\text{z})=\text{z}^2\cos\left(\text{z}\right)-e^{\text{z}^3-\text{z}}$$ Where $\text{z}\in\mathbb{C}$

Now, we get:

1. $$\text{z}=\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i$$
2. $$\text{z}^2=\left(\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i\right)^2=\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]+2\Re\left[\text{z}\right]\Im\left[\text{z}\right]i$$
3. $$\text{z}^3=\left(\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i\right)^3=\Re\left[\text{z}\right]\left(\Re^2\left[\text{z}\right]-3\Im^2\left[\text{z}\right]\right)+\Im\left[\text{z}\right]\left(3\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]\right)i$$
4. $$\text{z}^3-\text{z}=\text{z}\left(\text{z}^2-1\right)=\Re\left[\text{z}\right]\left(\Re^2\left[\text{z}\right]-3\Im^2\left[\text{z}\right]-1\right)-\Im\left[\text{z}\right]\left(1-3\Re^2\left[\text{z}\right]+\Im^2\left[\text{z}\right]\right)i$$
5. $$\cos\left(\text{z}\right)=\cos\left(\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i\right)=\cos\left(\Re\left[\text{z}\right]\right)\cosh\left(\Im\left[\text{z}\right]\right)-\sin\left(\Re\left[\text{z}\right]\right)\sinh\left(\Im\left[\text{z}\right]\right)i$$
6. $$e^{\text{z}^3-\text{z}}=e^{\text{z}^3}\cdot e^{-\text{z}}$$
7. $$e^{-\text{z}}=e^{-\left(\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i\right)}=e^{-\Re\left[\text{z}\right]}\cdot e^{-\Im\left[\text{z}\right]i}=e^{-\Re\left[\text{z}\right]}\cos\left(\Im\left[\text{z}\right]\right)-e^{-\Re\left[\text{z}\right]}\sin\left(\Im\left[\text{z}\right]\right)$$
8. $$e^{\text{z}^3}=e^{\Re\left[\text{z}\right]\left(3\Im^2\left[\text{z}\right]-\Re^2\left[\text{z}\right]\right)}\left(\cos\left(\Im\left[\text{z}\right]\left(3\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]\right)\right)-\sin\left(\Im\left[\text{z}\right]\left(3\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]\right)\right)i\right)$$

And use, when $\text{s}_1\space\wedge\space\text{s}_2\in\mathbb{C}$:

• $$\Re\left[\text{s}_1\pm\text{s}_2\right]=\Re\left[\text{s}_1\right]\pm\Re\left[\text{s}_2\right]$$
• $$\Im\left[\text{s}_1\pm\text{s}_2\right]=\Im\left[\text{s}_1\right]\pm\Im\left[\text{s}_2\right]$$

No answer has been selected. Can you finish the solution method mapped out by @Alan Turing?

Real part \begin{align} % \text{Re} \left( z^{2} \cos z \right) &= x^2 \cos (x) \cosh (y)-y^2 \cos (x) \cosh (y)+2 x y \sin (x) \sinh (y) \\ % \text{Re} \left( -e^{z^{3}-z} \right) % &= -e^{x^3-3 x y^2-x} \cos \left(-3 x^2 y+y^3+y\right) % \end{align}

Imaginary part \begin{align} % \text{Im} \left( z^{2} \cos z \right) &= -x^2 \sin (x) \sinh (y)+y^2 \sin (x) \sinh (y)+2 x y \cos (x) \cosh (y) \\ % \text{Im} \left( -e^{z^{3}-z} \right) % &= e^{x^3-3 x y^2-x} \sin \left(-3 x^2 y+y^3+y\right) % \end{align}