# College Math Teaching

## October 9, 2013

### Fun with complex numbers and particular solutions

I was fooling around with $y''+by'+cy = e^{at}cos(bt)$ and thought about how to use complex numbers in the case when $e^{at}cos(bt)$ is not a solution to the related homogenous equation. It then hit me: it is really quite simple.

First notes the following: $e^{rt}cos(st) = \frac{1}{2}(e^{(r + si)t} + e^{(r - si)t})$ and $e^{rt}sin(st) = \frac{1}{2i}(e^{(r + si)t} - e^{(r - si)t})$.

Then it is a routine exercise to see the following: given that $z = r+si, \bar{z} = r-si$ are NOT solutions to $p(m)= m^2 + bm + c = 0$ $p(m)$ is the characteristic equation of the differential equation. Then: attempt $y_p = Ae^{zt} + Be^{\bar{z}t}$ Put into the differential equation to see $y''_p + by'_p + cy_p = A(z^2+bz+c)e^{zt} + B(\bar{z}^2 + b\bar{z} + c)e^{\bar{z}t}$.

Then: if the forcing function is $e^{rt}cos(st)$, a particular solution is $y_p = Ae^{zt} + Be^{\bar{z}t}$ where $A = \frac{1}{2(p(z))}, B = \frac{1}{2(p(\bar{z}))}$. If the forcing function is $e^{rt}cos(st)$, a particular solution is $y_p = Ae^{zt} - Be^{\bar{z}t}$ where $A = \frac{1}{2i(p(z))}, B = \frac{1}{2i(p(\bar{z}))}$.

That isn’t profound, but it does lead to the charming exercise: if $z, \bar{z}$ are NOT roots to the quadratic with real coefficients $p(x)$, then $\frac{1}{p(z)} + \frac{1}{p(\bar{z})}$ is real as is $\frac{i}{p(z)} - \frac{i}{p(\bar{z})}$.

Let’s check this out: $\frac{1}{p(z)} + \frac{1}{p(\bar{z})} = \frac{p(\bar{z})+p(z)}{p(z)p(\bar{z})}$. Now look at the numerator and the denominator separately. The denominator: $p(z)p(\bar{z})= (z^2 + bz +c)(\bar{z}^2 + b\bar{z} + c) = (z^2 \bar(z)^2) + b(b (z \bar{z}) + (z(z \bar{z}) +\bar{z}(z \bar{z})) + c (\bar{z} + z) + (z^2 + \bar{z}^2)) + (c^2)$ Now note that every term inside a parenthesis is real.

The numerator: $z^2 + \bar{z}^2 + b (z + \bar{z}) + 2c$ is clearly real.

What about $\frac{i}{p(z)} - \frac{i}{p(\bar{z})}$? We need to only check the numerator: $i (z^2 - \bar{z}^2 + b(z - \bar{z}) + c-c)$ is indeed real.

Yeah, this is elementary but this might appear as an exercise for my next complex variables class.

## September 13, 2013

### Partial Fractions Expansion: sometimes complex numbers can save time.

Filed under: calculus, differential equations, integrals — Tags: , — collegemathteaching @ 8:56 pm

One sometimes needs to do a partial fraction expansion when one is integrating or when one is doing Laplace transforms. Most people know the standard methods: either gather terms and compare coefficients, or use selected (real) values for $x$.

But sometimes, (NOT all of the time), one can speed things up by using complex numbers.

Here is an example: expand $\frac{1}{(x+1)(x^2 + 1)}$.

Solution: set this up as $\frac{1}{(x+1)(x^2 + 1)}=\frac{A}{(x+1)}+\frac{Bx+C}{(x^2 + 1)}$.
Now clear denominators to obtain $1 = A(x^2+1)+ (Bx+C)(x+1)$.

Setting $x = -1$ yields $1 = 2A$ which means $A = \frac{1}{2}$

(Yes, I know that we used a number not in the domain of the original fraction…but why can we get away with that? :-))

Now set $x = i$ we obtain $1= (Bi+C)(i+1)=(B+C)i +C-B$. By comparing real and imaginary parts, we obtain $-B = C$ and then $C = \frac{1}{2}, B = \frac{-1}{2}$.

Here is a second, more complicated case. Expand $\frac{1}{x^3 -1} = \frac{A}{x-1}+ \frac{Bx + C}{x^2+x + 1}$.

Clear denominators again to obtain $1 = A(x^2+x+1)+ (Bx+C)(x-1)$. Trying $x = 1$ yields $A = \frac{1}{3}$.

Now use a primitive complex 3’rd root of unity: $x = e^{\frac{2\pi i}{3}}$; this causes the first term to vanish. The second term becomes immediately:
$B(e^{\frac{4\pi i}{3}}-e^{\frac{2\pi i}{3}}) + C(e^{\frac{2\pi i}{3}}-1)$ which simplifies to: $\sqrt{3}i(B + \frac{1}{2}C) - \frac{3}{2}C = 1$.
Comparing real and imaginary parts again: $C = \frac{2}{3}$ and $B = -\frac{1}{3}$.

Caveat: one has to be very comfortable with complex arithmetic to use this method, but some engineers and physicists are.