4

When dealing with complex trigonometric functions, it is quite natural to ask how the real/imaginary part of $\tan(a+bi)$ can be expressed using $a$ and $b$. Of course, since $\tan z$ and $\tanh z$ are tightly linked for complex variables, we could derive the real/imaginary part for hyperbolic tangent from the corresponding results for $\tanh(a+bi)$ and vice-versa. (We have $\tanh(iz)=i\tanh z$ and $\tan(iz)=i\tanh(z)$.)

I was not able to find this in a few basic sources I looked at. For example, I do not see it in the Wikipedia articles Trigonometric functions (current revision) and Hyperbolic function (current revision). (And List of trigonometric identities (current revision) does not mention much about complex trigonometric functions other than the relation to the exponential function.)

I have at least tried to find what are a results for some specific value of $a$ and $b$. I have tried a few values in WolframAlpha, for example, tangent of $2+i$, tangent of $1+2i$, tangent of $1+i$. On this site I found this question: Calculate $\tan(1+i)$.

I have tried to calculate this myself, probably my approach is rather cumbersome - I post it below as an answer. I will be grateful for references, different derivations, different expressions for this formula. (And I will also be grateful if I receive some corrections to my approach - but do not treat this primarily as a question, it is intended as a general question.)

  • Not objectively better, but some might prefer the derivation using $\tan z=\frac{1}{i}\frac{e^{2iz}-1}{e^{2iz}+1}$. – Wojowu Nov 04 '18 at 10:35

4 Answers4

2

We want to express $\tan(a+bi)$ in the form $$\tan(a+bi)=A(a,b)+B(a,b)i,$$ the two functions $A(a,b)$ and $B(a,b)$ are what we are looking for.

We have \begin{align*} \tan(a+bi)&=\frac{\sin(a+bi)}{\cos(a+bi)}\\ &\overset{(1)}=\frac{\sin a\cos(bi)+\cos(a)\sin(bi)}{\cos a\cos(bi)-\sin a\sin(bi)}\\ &\overset{(2)}=\frac{\sin a\cosh b+i\cos a\sinh b}{\cos a\cosh b-i\sin a\sinh b}\\ &=\frac{(\cos a\cosh b+i\sin a\sinh b)(\sin a\cosh b+i\cos a\sinh b)}{\cos^2a\cosh^2b+\sin^2a\sinh^2b}\\ &=\frac{\cos a\sin a(\cosh^2b-\sinh^2b)+i(\cos^2a+\sin^2a)\cosh b\sinh b}{\cos^2a\cosh^2b+\sin^2a\sinh^2b}\\ &=\frac{\cos a\sin a+i\cosh b\sinh b}{\cos^2a\cosh^2b+\sin^2a\sinh^2b} \end{align*}

$(1)$: Using sum angle formulas.
$(2)$: Using $\cos iz=\cosh z$ and $\sinh i = i\sinh z$.

We would like to simplify this further, it seems that double argument formulae might help. In the numerator we can use that $\cos a \sin a = \frac{\sin 2a}2$ and $\cosh b \sinh b = \frac{\sinh2b}2$. For the denominator let us try that from the double angle formulas $\cos2x=\cos^2x-\sin^2x=2\cos^2x-1=1-2\sin^2x$ and $\cosh2x=\cosh^2x+\sinh^2x=2\cosh^2x-1=2\sinh^2x+1$ we can get that \begin{align*} \cos^2x&=\frac{1+\cos2x}2\\ \sin^2x&=\frac{1-\cos2x}2\\ \cosh^2x&=\frac{\cosh2x+1}2\\ \sinh^2x&=\frac{\cosh2x-1}2\\ \end{align*} Now we have for the denominator $D$: \begin{align*} D&=\cos^2a\cosh^2b+\sin^2a\sinh^2b\\ &=\frac{1+\cos2a}2\cdot\frac{\cosh2b+1}2+\frac{1-\cos2a}2\cdot\frac{\cosh2b-1}2\\ &=\frac{1+\cos2a+\cosh2b+\cos2a\cosh2b}4+\frac{1+\cos2a-\cosh2b-\cos2a\cosh2b}4\\ &=\frac{\cos2a+\cosh2b}2 \end{align*} So altogether we get that $$\tan(a+bi)=\frac{\cos a\sin a+i\cosh b\sinh b}{\cos^2a\cosh^2b+\sin^2a\sinh^2b} = \frac{\sin2a+i\sinh2b}{\cos2a+\cosh2b}.$$ So for the real and imaginary part we get \begin{align*} A(a,b)&=\frac{\sin2a}{\cos2a+\cosh2b}\\ B(a,b)&=\frac{\sinh2b}{\cos2a+\cosh2b} \end{align*}

Oscar Lanzi
  • 39,403
  • How is the $b$ term in the denominators not hyperbolic? Denoms should be $\cos 2a+\color{blue}{\cosh 2b}$ if we want the right form for a pure imaginary argument. – Oscar Lanzi Nov 04 '18 at 10:56
  • Looks like it was just typos, corrected. – Oscar Lanzi Nov 04 '18 at 10:58
  • 1
    @OscarLanzi Thanks for the corrections, I should have been more careful. (I have read the answer again after posting it, but I obviously missed a few slip-ups.) – Martin Sleziak Nov 04 '18 at 10:59
1

By definition, $$ \tan z=\frac{\sin z}{\cos z} $$ Note that $\sin\bar{z}=\overline{\sin z}$ and $\cos\bar{z}=\overline{\cos z}$, so the real part is $$ \frac{1}{2}\left(\frac{\sin z}{\cos z}+\frac{\sin\bar{z}}{\cos\bar{z}}\right)= \frac{\sin(z+\bar{z})}{\cos z\cos\bar{z}} $$ and similarly the imaginary part is $$ \frac{1}{2i}\frac{\sin(z-\bar{z})}{\cos z\cos\bar{z}} $$ If $z=a+bi$, then $z+\bar{z}=2a$ and $z-\bar{z}=2bi$, whereas $$ \cos z=\cos a\cosh b-i\sin a\sinh b $$ because $\cos(ib)=\cosh b$ and $\sin(ib)=i\sinh b$. Also $$ \cos z\cos\bar{z}=\lvert\cos z\rvert^2= \cos^2a\cosh^2b+\sin^2a\sinh^2b $$ Therefore $$ \tan(a+bi)=\frac{\sin a\cos a}{\cos^2a\cosh^2b+\sin^2a\sinh^2b}+ i\frac{\sinh b\cosh b}{\cos^2a\cosh^2b+\sin^2a\sinh^2b} $$

egreg
  • 238,574
  • Thanks for the answer, this seems to be quite clever approach. The fact about complex conjugate of $\cos z$ and $\sin z$ probably hold a bit more generally - Holomorphic functions: is it true that $f(\bar{z})=\overline {f(z)}$? However, probably for some simple functions such as $\exp$, $\cos$, $\sin$ this can be derived also directly from the definition (from the expansion into Taylor series). – Martin Sleziak Nov 04 '18 at 10:57
  • @MartinSleziak Yes, the key fact is that the coefficients of the Taylor series are real. Or because $\overline{\exp(\bar{z})}$ is holomorphic as well and $\exp(z)-\overline{\exp(\bar{z})}$ is zero on the real axis. – egreg Nov 04 '18 at 11:01
1

Another option is the compound angle formula, viz. $$\tan(a+bi)=\frac{\tan a+\tan bi}{1-\tan a\tan bi}=\frac{\tan a+i\tanh b}{1-i\tan a\tanh b}=\frac{(\tan a +i\tanh b)(1+i\tan a\tanh b)}{1+\tan^2 a\tanh^2 b}.$$The real part is $\frac{\tan a (1-\tanh^2 b)}{1+\tan^2 a\tanh^2 b}=\frac{\tan a \operatorname{sech}^2 b}{1+\tan^2 a\tanh^2 b}$; the imaginary part is $\frac{\tanh b(1+\tan^2 a)}{1+\tan^2 a\tanh^2 b}=\frac{\tanh b\sec^2 a}{1+\tan^2 a\tanh^2 b}$.

J.G.
  • 115,835
0

Use the formula

$$\tan( \alpha + \beta) = \frac{\sin 2\alpha + \sin 2 \beta}{\cos 2 \alpha + \cos 2 \beta}$$

(the geometric interpretation: the complex number $e^{i 2 \alpha} + e^{i 2 \beta}$ has argument $\alpha + \beta$ - draw a picture!)

We get $$\tan(x+ i y) = \frac{\sin 2x + \sin i 2 y}{\cos 2x + \cos i 2 y} = \frac{\sin 2x + i \sinh 2y}{\cos 2x + \cosh 2y}$$

orangeskid
  • 53,909