Knowing when your product rules.

PDF Worksheet and Answer Key
Read through the lesson and then give it a shot! 
This lesson's topic is First Order Linear Ordinary Differential Equations. (Say that pi times fast.)
Let's make sure we can recall what each of these parts mean before we continue.
First Order: This means that the 'highest' derivative of the dependent variable (usually 'y') is one. That is, there are no second derivatives.
Linear: This means that the dependent variable and all it's derivatives are to the first power, and that the coefficient functions of those elements rely at most on the independent variable (usually 'x' or 't', doesn't matter!)
Ordinary Differential Equation: This simply means no partial derivatives are involved.
Alright, let's check out a generalized form and see if we can investigate a method to solve it.
Let's make sure we can recall what each of these parts mean before we continue.
First Order: This means that the 'highest' derivative of the dependent variable (usually 'y') is one. That is, there are no second derivatives.
Linear: This means that the dependent variable and all it's derivatives are to the first power, and that the coefficient functions of those elements rely at most on the independent variable (usually 'x' or 't', doesn't matter!)
Ordinary Differential Equation: This simply means no partial derivatives are involved.
Alright, let's check out a generalized form and see if we can investigate a method to solve it.
A first order linear ODE will look something like:
\[ Q(x)y'+H(x)y=L(x) \]
For some functions Q, H, and L of an independent variable \( x \) (in this case). Now \( L(x) \) might be zero or \( Q(x) \) might be 1, or a number of things, and that's why we needed to know what all the words meant to be able to know what we're looking at!
Dividing through by \( Q(x) \) will give us a standard form:
\[ y'+P(x)y = G(x) \]
Here, we just renamed the resulting functions because we're mathematicians and no one can stop us.
Ok, so the goal here in Differential Equations is to sniff out the mysterious function \( y(x) \).
\[ Q(x)y'+H(x)y=L(x) \]
For some functions Q, H, and L of an independent variable \( x \) (in this case). Now \( L(x) \) might be zero or \( Q(x) \) might be 1, or a number of things, and that's why we needed to know what all the words meant to be able to know what we're looking at!
Dividing through by \( Q(x) \) will give us a standard form:
\[ y'+P(x)y = G(x) \]
Here, we just renamed the resulting functions because we're mathematicians and no one can stop us.
Ok, so the goal here in Differential Equations is to sniff out the mysterious function \( y(x) \).
I'm going to ask you to reach deep back into the past and pull out a gem from Cal I that you know well. The PRODUCT RULE.
This says, with cowboy looseness, that \( \frac{d}{dx} f(x)g(x) = f'g+g'f \). There, that wasn't so bad. In fact, this looks an awfully lot like something we were just dealing with. If I replace \( f \) with \( y \) and waggle things about a bit, I get \( \frac{d}{dx} gy = gy'+g'y \). Then I could integrate with respect to \( x \) and recover \( y \)! Sadly, our general first order linear ODE is only almost that.
But we're a clever bunch, and we can fix it.
Suppose I multiplied both sides of the general form by some arbitrary function \( \phi(x) \). Now, I don't have any clue yet what this function is, it is simply a kind of 'oracle' that we're using at the moment:
\[ \phi(x)y'+\phi(x)P(x)y = \phi(x)G(x)\]
Well, that's a big mess, except for the fact that if \( \phi(x)P(x) = \phi'(x) \) it would cause exactly the product rule that we want. Now we can figure out what \( \phi(x) \) should be.
\[ \phi(x)P(x) = \phi'(x) \]
Moving things around, we can see the definition of the natural log derivative appear, and we can use it!
\[ \frac{ \phi'(x) }{ \phi(x) } = P(x) \Longrightarrow \ln{ \phi(x) } = \int P(x) \ dx \Longrightarrow \phi(x) = e^{ \int P(x) \ dx } \]
Awesome, now that \( \phi(x) \) has the behavior we want (that \( \phi'(x) = \phi(x)P(x) \) we can simplify the mess we had above:
\[ \phi(x)y'+\phi'(x)y = \phi(x)G(x) \]
That is, we've got exactly that product rule now, and can integrate it back into the original product it came from! (Product rule in reverse)
\[ \int \phi(x)y' + \phi'(x)y \ dx = \int \phi(x)G(x) \ dx \]
\[ \phi(x)y = \int \phi(x)G(x) \ dx \]
\[ y = \frac{ \int \phi(x)G(x) \ dx }{ \phi(x) } \]
We have obtained the desired \( y(x) \) function!
This says, with cowboy looseness, that \( \frac{d}{dx} f(x)g(x) = f'g+g'f \). There, that wasn't so bad. In fact, this looks an awfully lot like something we were just dealing with. If I replace \( f \) with \( y \) and waggle things about a bit, I get \( \frac{d}{dx} gy = gy'+g'y \). Then I could integrate with respect to \( x \) and recover \( y \)! Sadly, our general first order linear ODE is only almost that.
But we're a clever bunch, and we can fix it.
Suppose I multiplied both sides of the general form by some arbitrary function \( \phi(x) \). Now, I don't have any clue yet what this function is, it is simply a kind of 'oracle' that we're using at the moment:
\[ \phi(x)y'+\phi(x)P(x)y = \phi(x)G(x)\]
Well, that's a big mess, except for the fact that if \( \phi(x)P(x) = \phi'(x) \) it would cause exactly the product rule that we want. Now we can figure out what \( \phi(x) \) should be.
\[ \phi(x)P(x) = \phi'(x) \]
Moving things around, we can see the definition of the natural log derivative appear, and we can use it!
\[ \frac{ \phi'(x) }{ \phi(x) } = P(x) \Longrightarrow \ln{ \phi(x) } = \int P(x) \ dx \Longrightarrow \phi(x) = e^{ \int P(x) \ dx } \]
Awesome, now that \( \phi(x) \) has the behavior we want (that \( \phi'(x) = \phi(x)P(x) \) we can simplify the mess we had above:
\[ \phi(x)y'+\phi'(x)y = \phi(x)G(x) \]
That is, we've got exactly that product rule now, and can integrate it back into the original product it came from! (Product rule in reverse)
\[ \int \phi(x)y' + \phi'(x)y \ dx = \int \phi(x)G(x) \ dx \]
\[ \phi(x)y = \int \phi(x)G(x) \ dx \]
\[ y = \frac{ \int \phi(x)G(x) \ dx }{ \phi(x) } \]
We have obtained the desired \( y(x) \) function!
Have a cold drink, the hard part is over.So now you might be thinking "What, I have to do that every time?!". The good news is you absolutely do not have to do that every time, the stuff above is the full derivation of the method of solution, but it is endlessly helpful for a student to understand the origin of the method. Now that we have made a solution using only the general arbitrary form, we can apply that globally to all first order linear ODE's in the following way:

THE METHOD:
1. Have a first order linear ODE in standard form:
\[ y'+P(x)y=G(x) \]
2. Find the "Integrating Factor" \( e^{ \int P(x) \ dx} \):
In this example, I will call this "F" (since we have no actual functions yet to play with)
3. Write:
\[ Fy = \int FG(x) \ dx \]
4. Integrate, and isolate the "y".
Isolating the "y" is called finding an explicit solution and is not always possible with DEs, but is polite!
That's it, you're done. Let's practice one.
1. Have a first order linear ODE in standard form:
\[ y'+P(x)y=G(x) \]
2. Find the "Integrating Factor" \( e^{ \int P(x) \ dx} \):
In this example, I will call this "F" (since we have no actual functions yet to play with)
3. Write:
\[ Fy = \int FG(x) \ dx \]
4. Integrate, and isolate the "y".
Isolating the "y" is called finding an explicit solution and is not always possible with DEs, but is polite!
That's it, you're done. Let's practice one.
Ok, first we'll come up with a problem that is First Order, Linear, and an ODE:
\[ xy' + 3y = 4x^2  3x \]
Now we'll apply the method of solution!
1. Have a first order linear ODE in standard form:
This means we'll have to divide through by that leading \( x \) to get \( y' \) alone.
\[ y' + \frac{3}{x} y = 4x  3 \]
2. Find the "Integrating Factor" \( e^{ \int P(x) \ dx} \):
Since \( P(x) = \frac{3}{x} \) we obtain:
\[ e^{ \int \frac{3}{x} \ dx } = e^{ 3 \ln {x}} = e^{ \ln{x^3}} = x^3 \]
3. Write:
\[ x^3y = \int x^3 \left( 4x  3 \right) \ dx \]
\[ x^3y = \int 4x^4  3x^3 \ dx \]
4. Integrate, and isolate the "y".
\[ x^3y = \frac{4}{5} x^5  \frac{3}{4} x^4 + C \]
\[ y=\frac{4}{5} x^2\frac{3}{4} x + \frac{C}{x^3} \]
Done!
\[ xy' + 3y = 4x^2  3x \]
Now we'll apply the method of solution!
1. Have a first order linear ODE in standard form:
This means we'll have to divide through by that leading \( x \) to get \( y' \) alone.
\[ y' + \frac{3}{x} y = 4x  3 \]
2. Find the "Integrating Factor" \( e^{ \int P(x) \ dx} \):
Since \( P(x) = \frac{3}{x} \) we obtain:
\[ e^{ \int \frac{3}{x} \ dx } = e^{ 3 \ln {x}} = e^{ \ln{x^3}} = x^3 \]
3. Write:
\[ x^3y = \int x^3 \left( 4x  3 \right) \ dx \]
\[ x^3y = \int 4x^4  3x^3 \ dx \]
4. Integrate, and isolate the "y".
\[ x^3y = \frac{4}{5} x^5  \frac{3}{4} x^4 + C \]
\[ y=\frac{4}{5} x^2\frac{3}{4} x + \frac{C}{x^3} \]
Done!
closing thoughts and FAQ
As you may be increasingly aware, first course Differential Equations are very color by number in that the methods are cookbook and procedural, lending to quite a straight forward experience. A few concerns a student may have about the content above are:
"Why did we not have a +C on the antiderivative involved with finding the integrating factor?"
This is a great question, and basically what it amounts to is this: Consider \( e^{ \int P(x) \ dx} \) and let's just say that the antiderivative of \( P(x) \) is the function \( \lambda(x) \). Then our integrating factor (with the +C) would be \( e^{ \lambda(x) +C } = e^Ce^{ \lambda(x)} \), but \( e^C \) is just another constant, and since we are multiplying both sides of the ODE by the integrating factor, all this does is multiply both sides by the same constant, and does nothing. TL;DR, we can ignore the +C in the integrating factor's antiderivative!
"Why did we not have a +C on the antiderivative involved with finding the integrating factor?"
This is a great question, and basically what it amounts to is this: Consider \( e^{ \int P(x) \ dx} \) and let's just say that the antiderivative of \( P(x) \) is the function \( \lambda(x) \). Then our integrating factor (with the +C) would be \( e^{ \lambda(x) +C } = e^Ce^{ \lambda(x)} \), but \( e^C \) is just another constant, and since we are multiplying both sides of the ODE by the integrating factor, all this does is multiply both sides by the same constant, and does nothing. TL;DR, we can ignore the +C in the integrating factor's antiderivative!