# Real and Imaginary Parts of a Complex Valued Rational Fraction

I just want to know how to separate the real and the imaginary part of the following complex rational number. The purpose of this is for me to be able to compute the phase and gain margin of the following transfer function.

$H(s)=\frac{1-s}{s^2+s+1}$ or $H(jw)=\frac{1-jw}{(jw)^2+jw+1}$

I know that I needed to find the magnitude of the following transfer function and I am having trouble to do so because of the denominator.

• Are you supposed to know the real and imaginary parts of $s$ and/or $jw$? I you know how to find the real and imaginary parts of $\frac {a+bi}{c + di}$ where $a,b,c,d$ are real? By multiplying by conjugates? ($\frac {a+bi}{c+di}=\frac {(a+bi)(c-di)}{(c+di)(c-di)}=\frac {(ac+bd)+(bc-ad)i}{c^2 + d^2} = \frac {ac +bd}{c^2+d^2}+\frac{bd-ad}{c^2 + d^2} i$?) Just do that. May 6, 2018 at 15:16
• Do you want to find the real and imaginary parts or would finding the modulus and phase by other means do? May 6, 2018 at 15:16
• Hi, I just need to find the real and imaginary part of jw as it was converted to the complex plane (s=jw). My problem is how would I do that for the denominator. I tried to take the roots (i.e. s+0.5+j0.866 and s+0.5-j0.866) but I was having trouble of what conjugate to multiply to get its imaginary part. May 6, 2018 at 15:25
• If you can suggest other means to do it by manual calculation, would be very glad to know how to do it. Thanks May 6, 2018 at 15:26
• Is $w$ real valued? Is $j^2=-1$? Are you only interested in $|H(jw)|$?
– Did
May 6, 2018 at 16:05

The comments on the question provide a good amount of insight to finding a solution, but I noticed there were still unanswered questions on how to solve the original problem.

As you said, the straightforward way is to find the real and imaginary parts, then use the Pythagorean formula to find the magnitude. separating into real and imaginary parts is usually done as @fleablood stated by multiplying the top and bottom of the fraction by the denominator's complex conjugate. Then, the fraction can be separated into real and imaginary parts by the terms in the numerator.

In your case, let's start with the $$H(j\omega)$$ version of your rational function, as it seems to be what you're looking for. (It can be done but gets more complicated if you are working in the $$s$$ domain where $$s=\sigma + j\omega$$).

$$H(j\omega)=\frac{1−j\omega}{(j\omega)^2+j\omega+1}$$

The first simplification is in the denominator, as $$j^2=-1$$

$$H(j\omega)=\frac{1−j\omega}{-\omega^2+j\omega+1}$$

$$\omega$$ is a real valued number, so the complex conjugate for the denominator just has the sign of the complex term changed: $$1-\omega^2-j\omega$$

Now, rationalizing the fraction:

$$H(j\omega)=\frac{1−j\omega}{1-\omega^2+j\omega}\times\frac{1-\omega^2-j\omega}{1-\omega^2-j\omega}$$ $$= \frac{j\omega^3-2\omega^2-2j\omega+1}{\omega^4-\omega^2+1}$$ $$= \frac{-2\omega^2+1}{\omega^4-\omega^2+1}+j\frac{\omega^3-2\omega}{\omega^4-\omega^2+1}$$

With the real and imaginary parts separated, we can find the magnitude:

$$\lvert{H(j\omega)}\rvert = \sqrt{\left(\frac{-2\omega^2+1}{\omega^4-\omega^2+1}\right)^2+\left(\frac{\omega^3-2\omega}{\omega^4-\omega^2+1}\right)^2}$$ $$= \sqrt{\frac{\left(-2\omega^2+1\right)^2+\left(\omega^3-2\omega\right)^2}{\left(\omega^4-\omega^2+1\right)^2}}$$ $$= \sqrt{\frac{\omega^6+1}{\left(\omega^4-\omega^2+1\right)^2}}$$ $$= \sqrt{\frac{\left(\omega^2+1\right)\left(\omega^4-\omega^2+1\right)}{\left(\omega^4-\omega^2+1\right)^2}}$$

$$\lvert{H(j\omega)}\rvert = \sqrt{\frac{\omega^2+1}{\omega^4-\omega^2+1}}$$

There may be other ways of doing the algebraic manipulation, but this seemed the most straightforward. (Note that factoring $$\omega^6+1$$ uses the Sum of Cubes Identity recognizing that $$\omega^6+1 = \left(\omega^2\right)^3+1$$.

The final result was verified with the Maxima 5.43.0 cabs function, which results in the equivalent expression:

$$\lvert{H(j\omega)}\rvert = \sqrt{\frac{\omega^2+1}{\left(1-\omega^2\right)^2+\omega^2}}$$

• Setting magnitude =1 for phase margin, $$\omega = \sqrt {2}$$ then solve phase Sep 5, 2020 at 21:29
• Ermm Setting magnitude =0 for phase margin, $$\omega = ?$$ then solve phase Sep 5, 2020 at 21:36