# Taking absolute square of the following term

I have this equation and I wanted to find the absolute square of this term in Mathematica

$$H_1 = \left | 1 + j\; \left(\frac{ 2 \pi}{1-e^\lambda}\right) \right|^2$$

I did this in mathematica

H1 = Abs[1 + 1*i*((2*Pi)/ (1 - e^(-\[Lambda])))]^2


which does not yield any result.

then I did this

Can anyone help? As the absolute square is just square of real-term and imaginary term which should be simple. Solving this on paper is quite simple

$$H_1 = \left | 1 + j\; \left(\frac{ 2 \pi}{1-e^\lambda}\right) \right|^2$$

$$H_2 = \left | 1 + \; \left(\frac{ j2 \pi}{e^{(-j2\pi)}-e^{(-j2\pi\lambda)}}\right) \right|^2$$

Thank you very much, I made an edit in the question. Now I have H_2 as well, can you please look into H_2 at the end of the question and tell me how to calculate it's absolute square. My code for H_2 in Mathematica is

(ComplexExpand[#1, TargetFunctions -> {Re, Im}] & )[ Abs[1 + (I*2*Pi)/ ((2*Pi)/E^I - E^I*2*Pi* [Lambda])]^2] –

• You seem to be implicitly assuming that $\lambda$ is real... Jan 26, 2021 at 8:16
• @J.M. YES, $\lambda$ is real. Jan 26, 2021 at 10:18

Imaginary unit is I , not i, exponential constant is E  , not e and use option for ComplexExpand
Abs[1 + (2 I π)/(1 - E^-λ)]^2 //

• @good_omen92 - The code for H2 should be (ComplexExpand[#1, TargetFunctions -> {Re, Im}] &)[Abs[1 + (I*2*Pi)/(E^(I*2*Pi) - E^(I*2*Pi*\[Lambda]))]^2] // FullSimplify Jan 26, 2021 at 16:30