Skip to main content

CLP-2 Integral Calculus

Section B.2 The Complex Exponential

Subsection B.2.1 Definition and Basic Properties

There are two equivalent standard definitions of the exponential, \(e^z\text{,}\) of the complex number \(z=x+iy\text{.}\) For the more intuitive definition, one simply replaces the real number \(x\) in the Taylor series expansion
 1 
See Theorem 3.6.7.
\(e^x=\sum_{n=0}^\infty \frac{x^n}{n!}\) with the complex number \(z\text{,}\) giving
\begin{equation*} e^z=\sum_{n=0}^\infty \frac{z^n}{n!} \tag{EZ} \end{equation*}
We instead highlight the more computationally useful definition.

Definition B.2.1.

For any complex number \(z=x+iy\text{,}\) with \(x\) and \(y\) real, the exponential \(\, e^z\, \text{,}\) is defined by
\begin{equation*} e^{x+iy}\ =\ e^x\cos y+i e^x\sin y \end{equation*}
In particular
 2 
The equation \(e^{iy}\ =\ \cos y+i \sin y\) is known as Euler’s formula. Leonhard Euler (1707–1783) was a Swiss mathematician and physicist who spent most of his adult life in Saint Petersberg and Berlin. He gave the name \(\pi\) to the ratio of a circle’s circumference to its diameter. He also developed the constant \(e\text{.}\) His collected works fill 92 volumes.
, \(e^{iy}\ =\ \cos y+i \sin y\text{.}\)
We will not fully prove that the intuitive definition (EZ) and the computational Definition B.2.1 are equivalent. But we will do so in the special case that \(z=iy\text{,}\) with \(y\) real. Under (EZ),
\begin{equation*} e^{iy} = 1 +iy +\frac{(iy)^2}{2!}+\frac{(iy)^3}{3!}+\frac{(iy)^4}{4!} +\frac{(iy)^5}{5!}+\frac{(iy)^6}{6!}+\cdots \end{equation*}
The even terms in this expansion are
\begin{equation*} 1 +\frac{(iy)^2}{2!}+\frac{(iy)^4}{4!}+\frac{(iy)^6}{6!}+\cdots =1 -\frac{y^2}{2!}+\frac{y^4}{4!}-\frac{y^6}{6!}+\cdots =\cos y \end{equation*}
and the odd terms in this expansion are
\begin{equation*} iy +\frac{(iy)^3}{3!}+\frac{(iy)^5}{5!}+\cdots =i\Big(y-\frac{y^3}{3!}+\frac{y^5}{5!}+\cdots\Big) =i\sin y \end{equation*}
Adding the even and odd terms together gives us that, under (EZ), \(e^{iy}\) is indeed equal to \(\cos y + i\sin y\text{.}\)
 3 
It is obvious that, in the special case that \(z=x\) with \(x\) real, the definitions (EZ) and B.2.1 are equivalent. So to complete the proof of equivalence in the general case \(z=x+iy\text{,}\) it suffices to prove that \(e^{x+iy}=e^x e^{iy}\) under both (EZ) and Definition B.2.1. For Definition B.2.1, this follows from Lemma B.2.2, below.
As a consequence, we have
\begin{equation*} e^{i\pi}=-1 \end{equation*}
which gives an amazing linking between calculus (\(e\)), geometry (\(\pi\)), algebra (\(i\)) and the basic number \(-1\text{.}\)
In the next lemma we verify that the complex exponential obeys a couple of familiar computational properties.

Proof.

  1. For any two complex numbers \(z_1=x_1+iy_1\) and \(z_2=x_2+iy_2\text{,}\) with \(x_1\text{,}\) \(y_1\text{,}\) \(x_2\text{,}\) \(y_2\) real,
    \begin{align*} &e^{z_1}e^{z_2} = e^{x_1}(\cos y_1+i \sin y_1)e^{x_2}(\cos y_2+i \sin y_2) \\ &= e^{x_1+x_2}(\cos y_1+i \sin y_1)(\cos y_2+i \sin y_2) \\ &= e^{x_1+x_2}\left\{(\cos y_1\cos y_2\!-\!\sin y_1\sin y_2) +i (\cos y_1\sin y_2\!+\!\cos y_2\sin y_1)\right\} \\ &= e^{x_1+x_2}\left\{\cos(y_1+y_2)+i\sin(y_1+y_2)\right\} \end{align*}
    by the trig identities of Appendix A.8. This says exactly that
    \begin{equation*} e^{z_1}e^{z_2}= e^{(x_1+x_2)+i(y_1+y_2)} = e^{z_1+z_2} \end{equation*}
    and that the familiar multiplication formula also applies to complex exponentials.
  2. For any real number \(t\) and any complex number \(c=\alpha+i\beta\text{,}\) with \(\alpha\text{,}\) \(\beta\) real,
    \begin{equation*} e^{ct}=e^{\alpha t+i\beta t}=e^{\alpha t}[\cos( \beta t)+i\sin(\beta t)] \end{equation*}
    so that the derivative with respect to \(t\)
    \begin{align*} \diff{}{t} e^{ct} &=\alpha e^{\alpha t}[\cos( \beta t)+i\sin(\beta t)] +e^{\alpha t}[-\beta\sin( \beta t)+i\beta \cos(\beta t)] \\ &=(\alpha+i\beta) e^{\alpha t}[\cos( \beta t)+i\sin(\beta t)] \\ &=ce^{ct} \end{align*}
    is also the familiar one.

Subsection B.2.2 Relationship with \(\sin\) and \(\cos\)

Solving for \(\cos\theta\) and \(\sin\theta\) (by adding and subtracting the two equations) gives

Example B.2.5.

These formulae make it easy derive trig identities. For example,
\begin{align*} \cos\theta\cos\phi &= \frac{1}{4}\big(e^{i\theta}+e^{-i\theta}\big) \big(e^{i\phi}+e^{-i\phi}\big) \\ &= \frac{1}{4}\big(e^{i(\theta+\phi)}+e^{i(\theta-\phi)} +e^{i(-\theta+\phi)}+e^{-i(\theta+\phi)}\big) \\ &= \frac{1}{4}\big(e^{i(\theta+\phi)}+e^{-i(\theta+\phi)} +e^{i(\theta-\phi)} +e^{i(-\theta+\phi)}\big) \\ &= \frac{1}{2}\big(\cos(\theta+\phi)+\cos(\theta-\phi)\big) \end{align*}
and, using \((a+b)^3=a^3+3a^2b+3ab^2+b^3\text{,}\)
\begin{align*} \sin^3\theta&=-\frac{1}{8i}\big(e^{i\theta}-e^{-i\theta}\big)^3\cr &=-\frac{1}{8i}\big(e^{i3\theta}-3e^{i\theta} +3e^{-i\theta}-e^{-i3\theta}\big) \\ &=\frac{3}{4}\frac{1}{2i}\big(e^{i\theta}-e^{-i\theta}\big) -\frac{1}{4}\frac{1}{2i}\big(e^{i3\theta}-e^{-i3\theta}\big) \\ &=\frac{3}{4}\sin\theta-\frac{1}{4}\sin(3\theta) \end{align*}
and
\begin{align*} \cos(2\theta)&=\Re\big(e^{2\theta i}\big)=\Re \big(e^{i\theta}\big)^2 \\ &=\Re \big(\cos \theta+i\sin\theta\big)^2 \\ &=\Re \big(\cos^2 \theta+2i\sin\theta\cos\theta-\sin^2\theta\big) \\ &=\cos^2\theta-\sin^2\theta \end{align*}

Subsection B.2.3 Polar Coordinates

Let \(z=x+iy\) be any complex number. Writing \(x\) and \(y\) in polar coordinates in the usual way, i.e. \(x=r\cos(\theta)\text{,}\) \(y=r\sin(\theta)\text{,}\) gives
\begin{gather*} x+iy=r\cos\theta+ir\sin\theta=re^{i\theta}\qquad \end{gather*}
See the figure on the left below. In particular
\begin{alignat*}{4} 1 &=\ \ \ \ e^{i0} &&= e^{2\pi i} &&= e^{2k\pi i} &&\quad\text{for }k=0,\pm 1,\pm2,\cdots \\ -1 &=\ \ \ e^{i\pi} &&= e^{3\pi i} &&= e^{(1+2k)\pi i} &&\quad\text{for }k=0,\pm 1,\pm2,\cdots \\ i &=\ e^{i\pi/2} &&= e^{{5\over 2}\pi i} &&= e^{({1\over 2}+2k)\pi i} &&\quad\text{for }k=0,\pm 1,\pm2,\cdots \\ -i &= e^{-i\pi/2} &&=e^{{3\over 2}\pi i} &&= e^{(-{1\over 2}+2k)\pi i} &&\quad\text{for }k=0,\pm 1,\pm2,\cdots \end{alignat*}
See the figure on the right below.
The polar coordinate \(\theta=\arctan\frac{y}{x}\) associated with the complex number \(z=x+iy\text{,}\) i.e. the point \((x,y)\) in the \(xy\)-plane, is also called the argument of \(z\text{.}\)
The polar coordinate representation makes it easy to find square roots, third roots and so on. Fix any positive integer \(n\text{.}\) The \(n^{\rm th}\) roots of unity are, by definition, all solutions \(z\) of
\begin{equation*} z^n\ =\ 1 \end{equation*}
Writing \(z=re^{i\theta}\)
\begin{equation*} r^ne^{n\theta i}\ =\ 1e^{0i} \end{equation*}
The polar coordinates \((r,\theta)\) and \((r',\theta')\) represent the same point in the \(xy\)-plane if and only if \(r=r'\) and \(\theta=\theta'+2k\pi\) for some integer \(k\text{.}\) So \(z^n=1\) if and only if \(r^n=1\text{,}\) i.e. \(r=1\text{,}\) and \(n\theta =2 k\pi\) for some integer \(k\text{.}\) The \(n^{\rm th}\) roots of unity are all the complex numbers \(e^{2\pi i{k\over n}}\) with \(k\) integer. There are precisely \(n\) distinct \(n^{\rm th}\) roots of unity because \(e^{2\pi i{k\over n}}=e^{2\pi i{k'\over n}}\) if and only if \(2\pi {k\over n}-2\pi {k'\over n}=2\pi {k-k'\over n}\) is an integer multiple of \(2\pi\text{.}\) That is, if and only if \(k-k'\) is an integer multiple of \(n\text{.}\) The \(\, n\, \) distinct \(n^{\rm th}\) roots of unity are
\begin{equation*} 1\ ,\ e^{2\pi i{1\over n}}\ ,\ e^{2\pi i{2\over n}} \ ,\ e^{2\pi i{3\over n}}\ ,\ \cdots\ ,\ e^{2\pi i{n-1\over n}} \end{equation*}
For example, the \(6^{\rm th}\) roots of unity are depicted below.

Subsection B.2.4 Exploiting Complex Exponentials in Calculus Computations

You have learned how to evaluate integrals involving trigonometric functions by using integration by parts, various trigonometric identities and various substitutions. It is often much easier to just use (B.2.3) and (B.2.4). Part of the utility of complex numbers comes from how well they interact with calculus through the exponential function. Here are two examples.

Example B.2.6.

\begin{align*} \int e^x\cos x\ \dee{x}&=\frac{1}{2} \int e^x\big[e^{ix}+e^{-ix}\big]\ \dee{x} =\frac{1}{2} \int \big[e^{(1+i)x}+e^{(1-i)x}\big]\ \dee{x} \\ &=\frac{1}{2} \left[\frac{1}{1+i}e^{(1+i)x}+\frac{1}{1-i}e^{(1-i)x}\right]+C \end{align*}
This form of the indefinite integral looks a little weird because of the \(i\)’s. While it looks complex because of the \(i\)’s, it is actually purely real (and correct), because \(\frac{1}{1-i}e^{(1-i)x}\) is the complex conjugate of \(\frac{1}{1+i}e^{(1+i)x}\text{.}\) We can convert the indefinite integral into a more familiar form just by subbing back in \(e^{\pm ix}=\cos x\pm i\sin x\text{,}\) \(\frac{1}{1+i}=\frac{1-i}{(1+i)(1-i)}=\frac{1-i}{2}\) and \(\frac{1}{1-i}=\overline{\frac{1}{1+i}}=\frac{1+i}{2}\text{.}\)
\begin{align*} \int e^x\cos x\ \dee{x} &=\frac{1}{2} e^x\left[\frac{1}{1+i}e^{ix}+\frac{1}{1-i}e^{-ix}\right]+C\\ &=\frac{1}{2} e^x\left[\frac{1-i}{2}(\cos x+i\sin x) +\frac{1+i}{2}(\cos x-i\sin x)\right]+C \\ &=\frac{1}{2} e^x\cos x+\frac{1}{2} e^x\sin x+C \end{align*}
You can quickly verify this by differentiating (or by comparing with Example 1.7.11).

Example B.2.7.

Evaluating the integral \(\int\cos^nx\ \dee{x}\) using the methods of Section 1.8 can be a real pain. It is much easier if we convert to complex exponentials. Using \((a+b)^4=a^4+4a^3b+6a^2b^2+4ab^3+b^4\text{,}\)
\begin{align*} \int \cos^4 x\ \dee{x}&=\frac{1}{2^4} \int\big[e^{ix}+e^{-ix}\big]^4\ \dee{x}\\ &=\frac{1}{2^4} \int \big[e^{4ix}+4e^{2ix}+6+4e^{-2ix}+e^{-4ix}\big]\ \dee{x} \\ &=\frac{1}{2^4} \left[\frac{1}{4i}e^{4ix}+\frac{4}{2i}e^{2ix}+6x +\frac{4}{-2i}e^{-2ix}+\frac{1}{-4i}e^{-4ix}\right]+C\\ &=\frac{1}{2^4} \left[\frac{1}{2}\frac{1}{2i}(e^{4ix}-e^{-4ix}) +\frac{4}{2i}(e^{2ix}-e^{-2ix})+6x\right]+C\\ &=\frac{1}{2^4} \left[\frac{1}{2}\sin 4x+4\sin 2x+6x\right]+C \\ &=\frac{1}{32} \sin 4x+\frac{1}{4}\sin 2x+\frac{3}{8}x+C \end{align*}

Subsection B.2.5 Exploiting Complex Exponentials in Differential Equation Computations

Complex exponentials are also widely used to simplify the process of guessing solutions to ordinary differential equations. We’ll start with (possibly a review of) some basic definitions and facts about differential equations.

Definition B.2.8.

  1. A differential equation is an equation for an unknown function that contains the derivatives of that unknown function. For example \(y''(t)+y(t)=0\) is a differential equation for the unknown function \(y(t)\text{.}\)
  2. In the differential calculus text CLP-1, we treated only derivatives of functions of one variable. Such derivatives are called ordinary derivatives. A differential equation is called an ordinary differential equation (often shortened to “ODE”) if only ordinary derivatives appear. That is, if the unknown function has only a single independent variable.
    In CLP-3 we will treat derivatives of functions of more than one variable. For example, let \(f(x,y)\) be a function of two variables. If you treat \(y\) as a constant and take the derivative of the resulting function of the single variable \(x\text{,}\) the result is called the partial derivative of \(f\) with respect to \(x\text{.}\) A differential equation is called a partial differential equation (often shortened to “PDE”) if partial derivatives appear. That is, if the unknown function has more than one independent variable. For example \(y''(t)+y(t)=0\) is an ODE while \(\frac{\partial^2 u}{\partial\, t^2}(x,t)=c^2 \frac{\partial^2 u}{\partial\, x^2}(x,t)\) is a PDE.
  3. The order of a differential equation is the order of the highest derivative that appears. For example \(y''(t)+y(t)=0\) is a second order ODE.
  4. An ordinary differential equation that is of the form
    \begin{equation} a_0(t) y^{(n)}(t) + a_1(t) y^{(n-1)}(t)+\cdots +a_n(t)y(t) =F(t)\tag{B.2.1} \end{equation}
    with given coefficient functions \(a_0(t)\text{,}\) \(\cdots\text{,}\) \(a_n(t)\) and \(F(t)\) is said to be linear. Otherwise, the ODE is said to be nonlinear. For example, \(y'(t)^2+y(t)=0\text{,}\) \(y'(t)y''(t)+y(t)=0\) and \(y'(t)=e^{y(t)}\) are all nonlinear.
  5. The ODE (B.2.1) is said to have constant coefficients if the coefficients \(a_0(t)\text{,}\) \(a_1(t)\text{,}\) \(\cdots\text{,}\) \(a_n(t)\) are all constants. Otherwise, it is said to have variable coefficients. For example, the ODE \(y''(t)+7y(t)=\sin t\) is constant coefficient, while \(y''(t)+ty(t)=\sin t\) is variable coefficient.
  6. The ODE (B.2.1) is said to be homogeneous if \(F(t)\) is identically zero. Otherwise, it is said to be inhomogeneous or nonhomogeneous. For example, the ODE \(y''(t)+7y(t)=0\) is homogeneous, while \(y''(t)+7y(t)=\sin t\) is inhomogeneous. A homogeneous ODE always has the trivial solution \(y(t)=0\text{.}\)
  7. An initial value problem is a problem in which one is to find an unknown function \(y(t)\) that satisfies both a given ODE and given initial conditions, like \(y(t_0)=1\text{,}\) \(y'(t_0)=0\text{.}\) Note that all of the conditions involve the function \(y(t)\) (or its derivatives) evaluated at a single time \(t=t_0\text{.}\)
  8. A boundary value problem is a problem in which one is to find an unknown function \(y(t)\) that satisfies both a given ODE and given boundary conditions, like \(y(t_0)=0\text{,}\) \(y(t_1)=0\text{.}\) Note that the conditions involve the function \(y(t)\) (or its derivatives) evaluated at two different times.
The following theorem gives the form of solutions to the linear
 4 
There are a some special classes of nonlinear ODE’s, like the separable differential equations of §2.4, that are relatively easy to solve. But generally, nonlinear ODE’s are much harder to solve than linear ODE’s.
ODE (B.2.1).
In the following example we’ll derive one widely used linear constant coefficient ODE.

Example B.2.10. RLC circuit.

As an example of how ODE’s arise, we consider the RLC circuit, which is the electrical circuit consisting of a resistor of resistance \(R\text{,}\) a coil (or solenoid) of inductance \(L\text{,}\) a capacitor of capacitance \(C\) and a voltage source arranged in series, as shown below. Here \(R\text{,}\) \(L\) and \(C\) are all nonnegative constants.
We’re going to think of the voltage \(x(t)\) as an input signal, and the voltage \(y(t)\) as an output signal. The goal is to determine the output signal produced by a given input signal. If \(i(t)\) is the current flowing at time \(t\) in the loop as shown and \(q(t)\) is the charge on the capacitor, then the voltages across \(R\text{,}\) \(L\) and \(C\text{,}\) respectively, at time \(t\) are \(Ri(t)\text{,}\) \(L\diff{i}{t}(t)\) and \(y(t)=\frac{q(t)}{C}\text{.}\) By the Kirchhoff’s law
 5 
Gustav Robert Kirchhoff (1824–1887) was a German physicist. There are several sets of Kirchhoff’s laws that are named after him — Kirchhoff’s circuit laws, that we are using in this example, Krichhoff’s spectroscopy laws and Kirchhoff’s law of thermochemistry. Kirchhoff and his collaborator Robert Bunsen, of Bunsen burner fame, invented the spectroscope.
that says that the voltage between any two points has to be independent of the path used to travel between the two points, these three voltages must add up to \(x(t)\) so that
\begin{equation} Ri(t) + L\diff{i}{t}(t) + \frac{q(t)}{C} = x(t)\tag{B.2.3} \end{equation}
Assuming that \(R,\ L,\ C\) and \(x(t)\) are known, this is still one differential equation in two unknowns, the current \(i(t)\) and the charge \(q(t)\text{.}\) Fortunately, there is a relationship between the two. Because the current entering the capacitor is the rate of change of the charge on the capacitor
\begin{equation} i(t)=\diff{q}{t}(t) = Cy'(t)\tag{B.2.4} \end{equation}
This just says that the capacitor cannot create or destroy charge on its own; all charging of the capacitor must come from the current. Substituting (B.2.4) into (B.2.3) gives
\begin{equation*} LCy''(t) + RCy'(t) + y(t) = x(t) \end{equation*}
which is a second order linear constant coefficient ODE. As a concrete example, we’ll take an ac voltage source and choose the origin of time so that \(x(0)=0\text{,}\) \(x(t)=E_0\sin(\omega t)\text{.}\) Then the differential equation becomes
\begin{equation} LCy''(t)+RCy'(t)+y(t)=E_0\sin(\omega t)\tag{B.2.5} \end{equation}
Finally, here are two examples in which we use complex exponentials to solve an ODE.

Example B.2.11.

By Theorem B.2.9(a), the general solution to the ordinary differential equation
\begin{equation*} y''(t)+4y'(t)+5y(t)=0 \tag{ODE} \end{equation*}
is of the form \(C_1 u_1(t)+C_2 u_2(t)\) with \(u_1(t)\) and \(u_2(t)\) being two (independent) solutions to (ODE) and with \(C_1\) and \(C_2\) being arbitrary constants. The easiest way to find \(u_1(t)\) and \(u_2(t)\) is to guess them. And the easiest way to guess them is to try
 6 
The reason that \(y(t)=e^{rt}\) is a good guess is that, with this guess, all of \(y(t)\text{,}\) \(y'(t)\) and \(y''(t)\) are constants times \(e^{rt}\text{.}\) So the left hand side of the differential equation is also a constant, that depends on \(r\text{,}\) times \(e^{rt}\text{.}\) So we just have to choose \(r\) so that the constant is zero.
\(y(t)=e^{rt}\text{,}\) with \(r\) being a constant to be determined. Substituting \(y(t)=e^{rt}\) into (ODE) gives
\begin{gather*} r^2 e^{rt} +4re^{rt}+5e^{rt}=0 \iff\big(r^2 +4r+5\big)e^{rt}=0 \iff r^2 +4r+5=0 \end{gather*}
This quadratic equation for \(r\) can be solved either by using the high school formula or by completing the square.
\begin{align*} r^2 +4r+5=0 &\iff (r+2)^2+1=0\\ &\iff (r+2)^2=-1 \iff r+2=\pm i \\ &\iff r=-2\pm i \end{align*}
So the general solution to (ODE) is
\begin{gather*} y(t)=C_1e^{(-2+i)t} + C_2e^{(-2-i)t} \end{gather*}
This is one way to write the general solution, but there are many others. In particular there are quite a few people in the world who are (foolishly) afraid
 7 
Embracing the complexity leads to simplicity.
of complex exponentials. We can hide them by using (B.2.3) and (B.2.4).
\begin{align*} y(t)&=C_1e^{(-2+i)t} + C_2e^{(-2-i)t} =C_1e^{-2t}e^{it} + C_2 e^{-2t}e^{-it} \\ &=C_1e^{-2t}\big(\cos t+i\sin t \big) +C_2 e^{-2t}\big(\cos t-i\sin t \big) \\ &=(C_1+C_2) e^{-2t} \cos t +(iC_1-iC_2) e^{-2t}\sin t \\ &=D_1 e^{-2t} \cos t +D_2 e^{-2t}\sin t \end{align*}
with \(D_1=C_1+C_2\) and \(D_2=iC_1-iC_2\) being two other arbitrary constants. Don’t make the mistake of thinking that \(D_2\) must be complex because \(i\) appears in the formula \(D_2=iC_1-iC_2\) relating \(D_2\) and \(C_1,C_2\text{.}\) No one said that \(C_1\) and \(C_2\) are real numbers. In fact, in typical applications, the arbitrary constants are determined by initial conditions and often \(D_1\) and \(D_2\) turn out to be real and \(C_1\) and \(C_2\) turn out to be complex. For example, the initial conditions \(y(0)=0\text{,}\) \(y'(0)=2\) force
\begin{align*} 0&=y(0) = C_1 + C_2 \cr 2&=y'(0) = (-2+i)C_1 + (-2-i)C_2 \end{align*}
The first equation gives \(C_2=-C_1\) and then the second equation gives
\begin{align*} (-2+i)C_1 - (-2-i)C_1 = 2 &\iff 2iC_1=2 \iff iC_1=1\\ &\iff C_1=-i,\ C_2=i \end{align*}
and
\begin{gather*} D_1=C_1+C_2=0\qquad D_2=iC_1-iC_2=2 \end{gather*}

Example B.2.12.

We shall now guess one solution (i.e. a particular solution) to the differential equation
\begin{equation*} y''(t)+2y'(t)+3y(t)=\cos t \tag{ODE1} \end{equation*}
Equations like this arise, for example, in the study of the RLC circuit. We shall simplify the computation by exploiting that \(\cos t=\Re e^{it}\text{.}\) First, we shall guess a function \(Y(t)\) obeying
\begin{equation*} Y''+2Y'+3Y=e^{i t} \tag{ODE2} \end{equation*}
Then, taking complex conjugates gives
\begin{equation*} \bar Y''+2\bar Y'+3\bar Y=e^{-i t} \end{equation*}
which we shall call (\(\overline{\text{ODE2}}\)). Then, adding \(\frac{1}{2}\)(ODE2) and \(\frac{1}{2}\)(\(\overline{\text{ODE2}}\)) together will give
\begin{equation*} (\Re Y)''+2(\Re Y)'+3(\Re Y)=\Re e^{i t}=\cos t \end{equation*}
which shows that \(\Re Y(t)\) is a solution to (ODE1). Let’s try \(Y(t)=Ae^{i t}\text{,}\) with \(A\) a constant to be determined. This is a solution of (ODE2) if and only if
\begin{align*} & & \frac{\mathrm{d^2}}{\mathrm{d}t^2}\big(Ae^{it}\big) +2\diff{}{t}\big(Ae^{it}\big) +3Ae^{it}&=e^{it} \\ &\iff& (i^2+2i+3)Ae^{it}&=e^{it} \\ &\iff& A&=\frac{1}{2+2i} \end{align*}
So \(\frac{e^{it}}{2+2i}\) is a solution to (ODE2) and \(\Re \frac{e^{it}}{2+2i}\) is a solution to (ODE1). To simplify this, write \(2+2i\) in polar coordinates. From the sketch below we have \(2+2i=2\sqrt{2}e^{i{\pi\over 4}}\text{.}\)
So
\begin{align*} \frac{e^{it}}{2+2i}&=\frac{e^{it}}{2\sqrt{2}e^{i{\pi\over 4}}} =\frac{1}{2\sqrt{2}}e^{i(t-{\pi\over 4})} \\ \implies \Re\frac{e^{it}}{2+2i} &=\frac{1}{2\sqrt{2}}\Re e^{i(t-{\pi\over 4})} =\frac{1}{2\sqrt{2}}\cos\left(t-\frac{\pi}{4}\right) \end{align*}