In this calculus, algebra, and complex number tutorial, we will learn how to write the reciprocal of a complex number in the standard or rectangular form. We will also explain how to write a Python script that can be used to verify analytical computations. This tutorial is very important for mechanical and electrical engineering students interested in electrical circuits, signal processing, fluid mechanics, electrical networks, power systems, and control theory. The YouTube video tutorial is given below.
Problem Statement and Solution
We consider the following problem. Consider the following expression
(1)
where is the imaginary unit. Provide the answer to the following question and solve the following problem
where is a real part of and is the imaginary part of .
Solution. The expression (1) is a complex number. This will become clear after solving the problem. Generally speaking, a reciprocal of a complex number is a complex number. To solve the problem, we need to somehow transform the expression for into an expression in which the denominator will be a real number. To do that, we need to use one very simple idea. Namely, let be a complex number with the real part and the imaginary part . Then if we multiply by its complex conjugate, we obtain the following expression
(3)
The last expression can be written as follows
(4)
From (4) we conclude that if we multiply a complex number by its complex conjugate, we will obtain a real number. This is important since we can use this trick to get rid of the complex number in the denominator of (1). Also, another thing should be observed. Namely, the expression (3) is very similar to the well-known expression for the difference of squares of two real numbers
(5)
Let us now use this trick to solve the problem. From (1), we have
(6)
Over here, we multiplied both the numerator and denominator of with the complex conjugate of . That is, with . The idea is to get rid of the complex number in the denominator. As the result, from (7), we obtain
(7)
This solves our problem. The real part is given by and the imaginary part is given by .
Python Script for Computing Reciprocal of Complex Number
Here, we present a Python script for computing a reciprocal of a complex number. There are two approaches for computing the inverse complex number. The first approach is to use built-in Python complex number functions. The second approach is to use the SymPy Python library. The SymPy library is a Python symbolic computation library that is very useful for manipulating and simplifying complex expressions. The Python script is given below.
# -*- coding: utf-8 -*-
"""
Reciprocal of Complex Numbers
@author: Aleksandar Haber
Date: November 2023
"""
# two approached for computing a reciprocal of a complex number
# Python
# First approach - by using the built-in comple operations
# 1j is the standard notatio for the imaginary unit in Python
R1=1/(3+2j)
# Second approach - by using SymPy
# - symbolic Python library
from sympy import *
init_printing()
# I is the imaginary unit in SymPy
z1 = 3 + I*2
R2=1/z1
R3=simplify(R2)
R3
print(R3)