Friday, June 13, 2014

Crux Move #3: Assume a Solution

A CRUX MOVE is a math trick that comes up so often someone should make a list of them and post them on the interwebs. One such trick might be all that stands between you and solving your problem. Keep them at your fingertips and your mathematical life will get easier. 

In the business world, it's known as "fake it 'till you make it." Act as though ye have faith and faith shall be given.

In the math world, it's called: assume a solution.

What's the worst that could happen? The worst that could happen is that it doesn't work. Or, I suppose, someone could say: Hey! You can't do that! Then you say: YOU'RE NOT THE BOSS OF ME. Then they'll say: Why are you shouting? You say: I DON'T KNOW.

Assume a solution.

Examples after the jump.



CRUX MOVE #3
Assume a solution

The examples for this crux move are rather calculus-heavy. However, my final example computes the sum of a geometric series. That's sort of pre-calculus-ish, no?


E X A M P L E   1
Find a solution to: x'' + kx = 0, where x = x(t) and k is a constant.

The classic (undamped) mass-spring oscillator, here having mass equal to one. This equation gets so beaten to death you probably can't remember the first time you encountered it. Yet, I claim you could solve this even if you have no knowledge of differential equations whatsoever (yes, yes, you have to know what a derivative is. Crikey, work with me here).

If you really, truly, literally had to solve this ODE, say to escape some SAW-like contraption, how would you proceed?

Jigsaw doesn't want to see your work, he just wants a function that satisfies the equation. Suppose you built a mass-spring oscillator. What does it do? It bounces up and down (or left and right, depending on how you build it. Also, any real oscillator is going to include damping, which the given equation omits, so maybe just build it in your brain. Gedanken experiment, Einstein called it).

The solution x(t) describes the behavior of the mass, which as we just said is tracing out some sort of periodic motion. Square waves and sawtooths and Bessel functions are periodic, none of which really have a graph that look like what the mass is doing. How about something simple, like sin(t)? Differentiating twice gives us -sin(t). Substituting into the equation gives:

   -sin(t) + k sin(t) = 0

which is wrong (oops). No worries. We can get a k out front by including a √k in the function: x(t) = sin(√kt). Check: second derivative is -k sin(√kt), and x'' + kx is indeed zero. Taa-dah.

Footnote: The ODE-savvy will rightly complain this is not the general solution (note cos(√kt) is also solution, as is the sum sin(√kt) + cos(√kt). You can also multiply any of these by a constant and it will be a solution). To put it another way, if Jigsaw had given you initial conditions, things may have gone bad for you. I'll be less cavalier in the next example. The point is, we got a solution simply by assuming it. You're allowed to do that.


E X A M P L E   1b
Find the general solution of the 5th-order ODE: x''''' – 7x''' + 12x' = 0

If you thought my undamped oscillator example was corny, I would remind you "assume a solution" is how all homogeneous ODE with constant coefficients are solved. To wit: we assume x(t) = exp(λt). Substitution into the ODE leads to an algebraic equation in λ (called the characteristic polynomial). The roots of the polynomial determine the solution.

For the given ODE, the substitution x(t) = exp(λt) produces:

   λ5 exp(λt) – 7λ3 exp(λt) + 12λ exp(λt) = 0

or:

   [ λ5  – 7λ3 + 12λ ] exp(λt) = 0

This will be satisfied if  λ5  – 7λ3 + 12λ = 0. Clearly λ = 0 is one root. After some thrashing, we find the other four are ±2, and ±√3. Thus, the general solution is x(t) = c1 + c2 exp(2t) + c3 exp(-2t) + c4 exp(√3t) + c5 exp(-√3t). If we were given five initial conditions, we could solve for the five constants.

Footnote: Here, as everywhere in mathematics, repeated roots are a pain. A root r of multiplicity m does not simply generate terms c1 exp(rt), c2 exp(rt), ... , cm exp(rt). Rather it generates terms: c1 exp(rt),  c2 x exp(rt), c3 x2 exp(rt), ... , cm–1 xm–1exp(rt). Why? Go ask d'Alembert. The rest of the solution process is the same.<


E X A M P L E   2
Integrate: ∫ ln(x) dx

Assume a solution: x ln(x) (see Footnote). Taking the derivative we get ln(x) + 1 which is almost the integrand except for the + 1 part. So we need something that kills off the + 1 term when differentiated. Hey, x will do that! d/dx(ln(x) – x) = ln(x). Hence:

    ∫ ln(x) dx = x ln(x) – x + C

where C is a constant of integration.

Footnote: How did I think to try x ln(x)? Excellent question. You probably encountered this integral when covering integration by parts -- it's the classic example of that weird case where you rewrite an integral  ∫ wawa(x) dx as  ∫ 1 ⋅ wawa(x) dx. You can now apply IBP and get the solution. This leads to a technique we dubbed Turbo IBP where you just skip to the end. Given an integral  ∫ wawa(x) try a solution: x ⋅ wawa(x). Sometimes it works right out of the box; sometimes (as in this example) you have to tweak things a bit. And sometimes it leads nowhere. But even then, you've only wasted a few minutes.


E X A M P L E   3
Solve the PDE:  ∂2u/∂x2 = ∂u/∂t

Partial differential equations are the boss levels of calculus. Usually, I won't even speak their name in the pages of LabKitty. However, I dare include this example because -- with some caveats mentioned after -- assuming a solution knocks this rat bastard to its knees.

Our solution u(x,t) is a function of two variables x and t (space and time, if you will). The crux move is to assume u(x,t) can be written as the product of two functions, the first wholly a function of x and the other wholly a function of t. In symbols: u(x,t) = X(x)T(t).

Substitute this into the PDE, and after rearranging we obtain:

   X'' / X = T' / T

The LHS is a function of x.  The RHS is a function of t. The only way a function of x can be equal to a function of t for all values of x and t is for both to be equal to the same constant (bonus crux move!). Thus, we have reduced one PDE to two ODE:<

   X'' / X = -k

   T' / T = -k

(I used -k for convenience; +k also works). Rearranging:

   X'' + kX = 0

   T' + kT = 0

You may recognize the first equation (scroll up). The second equation is a first order ODE which has straightforward solution. We have:

   X = A sin √kx + B cos √kx

   T = C exp(–kt)

and the solution is: u(x,t) = C exp(–kt) [ A sin √kx + B cos √kx ]. You can verify this by substitution.

Footnote: There's a bit more to a proper solution of the PDE than I show here. First, how do we know our solution is the only solution? We got burned by this back in Example 1. And what about boundary conditions? The first question leads us to the general issues of uniqueness and existence. And dealing with boundary conditions leads to some complications (specifically, it leads to Fourier Series). I refer the interested reader to your favorite PDE textbook.

Footnote: The technique used here is called separation of variables and shows up often when dealing with PDE. Also, textbooks typically use k2 instead of k in the second crux move so they don't get square roots in their solution like I did. Also, there's nothing that says we can't use k = 0 in our solution. This generates a linear rather than a sinusoidal solution in x.

Footnote: You may recognize this example as the (one dimensional) diffusion equation, usually written c2 uxx = ut where c describes the media (air, syrup, tears). The PDE also describes heat conduction, in which case u is temperature and c is thermal diffusivity.


E X A M P L E   4
Compute: Σ   k=0,∞  xk    ( –1 < x < +1)

Notation alert:  Σ k=0,∞ means  "sum (on k) from zero to infinity." That is,  Σ k=0,∞  xk = 1 + x + x2 + ...

Assume the solution. Call it S. We have:

   S = 1 + x + x2 + x3 + ...

Multiply both sides by x:

   xS =  x + x2 + x3 + x4 + ...

Subtract the second expression from the first:

   S – xS = 1

And we obtain S(1 – x) = 1 or S = 1/(1 – x).

Perhaps the greatest rabbit-out-of-a-hat magic trick in all of mathematics.

Previous Move: Substitute a Taylor Series
Next Move: Apply a Trig Identity

No comments:

Post a Comment