Sunday, September 2, 2012

Checking Your Answers

One of the great things about Diff EQs is you can always check your answer. The checks aren't necessarily super easy, though, so I'd recommend waiting until the end of an exam and checking if you still have time left over. Your professor will probably take off points for algebraic or differentiation errors, so checking is definitely a good idea!

Say you're solving the equation:

y'' - 10y' + 25y = 0; y(0) = 1, y'(0) = 0

And you've come up with the following solution:

y(x) = e5x - 5xe5x

First make sure your first initial condition holds: y(0) = 1

y(0) = e5*0 - 5*0*e5*0y(0) = 1 - 0 = 1

Now take the derivative of your equation:

y'(x) = 5e5x - 5e5x - 25xe5x     (notice that you must use product rule on the second term)
y'(x) = -25xe5x

Check your second initial condition: y'(0) = 0

y'(0) = -25*0*e5*0y'(0) = 0

Now take the second derivative:

y''(x) = -25e5x - 125xe5x      (product rule again)

Now you have y'', y', and y - you can substitute these into the original equation and make sure it all equals zero.

y'' - 10y' + 25y = 0
-25e5x - 125xe5x - 10(-25xe5x) + 25(e5x - 5xe5x) = 0
-25e5x - 125xe5x + 250xe5x + 25e5x - 125xe5x = 0

Notice the 1st and 4th terms cancel, and the 2nd, 3rd, and 5th terms cancel, so the whole thing equals 0, and your solution checks out. Go ahead and try this anytime you're doubting yourself!

Happy calculating,
Rachel

Amplitude-Phase Form

All the equations shown in my last blog post can be written in a different, equivalent form called amplitude-phase form. Converting to amplitude-phase form is not difficult, just take a few easy steps:

Find A. A is the amplitude, and it is equal to √(c12 + c22).

Find θ. θ is the phase angle, and it can be found via its sine and cosine. cosθ = c1/A, and sinθ = c2/A. You can then use either arccosine or arcsine to find θ, but remember that both of those functions yield two answers, since all sines/cosines correspond to two different angles in two different quadrants, and your calculator won't necessarily give you the right one. So use the information about the sign of your cosine and sine to choose the angle in the correct quadrant. Remember that cosine is always positive in the quadrants 1 and 4 and negative in 2 and 3. Sine is positive in 1 and 2 and negative in 3 and 4.

Then assemble your terms like so:

y(x) = Aeβxcos(γx - θ)

And that's the equation in amplitude-phase form. You're done!

Your professor might want more steps shown than what I have here. This is just the answer. The proof will be included in another blog post.

Let's do an example problem. Say you've found the following answer to an initial value problem and you want to put it in amplitude phase form:

y = cos(2x) - √3sin(2x)

First find A: your coefficients are 1 and √3, so A is: √(12 + (-√3)2) = √(1 + 3) = 2.

Now find θ. The two pieces of information we know about θ are that cosθ = 1/2 and sinθ = -√3/2.
This is where you have to remember some trigonometry. There are two "special" triangles that you ought to remember some information about. Here they are:

Right triangles whose angles are as shown will always have side lengths in proportion to the values shown. Back to our example problem, we are looking for an angle with cosine (adjacent over hypotenuse) of 1/2, and sine (opposite over hypotenuse) of -√3/2. See anything helpful above? If you guessed  π/3, you got it. Note that the angle labelled π/3 on the righthand triangle has got hypotenuse 2, opposite side √3, and adjacent side 1.

But the sine is negative for the angle we're looking for. π/3 is in the first quadrant, where both sine and cosine are positive. The only quadrant in which cosine is positive and sine is negative is the fourth quadrant. So the angle we're really looking for is one in the fourth quadrant that is π/3 away from the x axis. This can be found by 2π - π/3 = 5π/3. That is the value of θ.

Now that we have both A and θ, just arrange everything into the correct form. Your final answer is y = 2cos(2x - 5π/3).

Note that, when solving for θ, if your sine and cosine are not on those triangles, and they're not 0 or 1, your professor cannot possibly expect you to know the arcsines and arccosines required to find θ unless he allows you to use a calculator on your test. You can leave these alone, just might want to write down which quadrant as well to show that you know that.

I mentioned 0 and 1 because they're on the unit circle, which you should also try and remember from trigonometry:

Recall that cosine is x and sine is y. So, for example, if you've got a cosine of 0 and a sine of 1, look at the point (0, 1). The angle π/2 is there. And that's how you use the unit circle.

Happy calculating,
Rachel