First-Order Differential Equations


First-Order Differential Equations

Corey
Today we’re solving two first-order differential equations using two different methods. The first is separable, and the second is linear. In each case, we’ll use the given initial condition to find the constant in the solution.

Anna
Let’s start with the first one: x squared times dy over dx equals four x squared minus x minus two, all divided by (x plus one)(y plus one), with y equal to one when x equals one.

Corey
The key clue is that the expression involving y is just y plus one, while the other factors involve x. Multiply both sides by y plus one and divide by x squared. Then multiply by dx, so the y terms and x terms can be placed on opposite sides.

Anna
That gives us (y plus one) dy equals (four x squared minus x minus two) divided by x squared times (x plus one), dx. Now each side contains only one variable, so we can integrate both sides.

Corey
Before integrating the right side, simplify it using partial fractions. The denominator is x squared times (x plus one), so we need a term over the linear factor, and two terms for the repeated x factor: A over (x plus one), plus B over x, plus C over x squared.

Anna
After multiplying through by x squared times (x plus one), the identity becomes four x squared minus x minus two equals A x squared plus Bx times (x plus one), plus C times (x plus one). Comparing coefficients gives A plus B equals four, B plus C equals minus one, and C equals minus two.

Corey
So C is minus two. Substituting that into B plus C equals minus one gives B equals one. Then A plus B equals four gives A equals three. The fraction therefore breaks into three over (x plus one), plus one over x, minus two over x squared.

Anna
Now integrate both sides. The left side, the integral of (y plus one) dy, is y squared over two plus y. On the right, the first two terms give three ln of the absolute value of x plus one, and ln of the absolute value of x.

Corey
The last term is minus two over x squared, or minus two x to the minus two. Its integral is two over x. So we have y squared over two plus y equals three ln|x plus one| plus ln|x| plus two over x, plus a constant C.

Anna
Use the initial condition x equals one and y equals one. The left side becomes one half plus one, or three halves. On the right, three ln 2 stays, ln 1 is zero, and two over one is two.

Corey
So three halves equals three ln 2 plus two plus C. Solving gives C equals minus one half minus three ln 2. Since three ln 2 is ln 8, we can also write C as minus one half minus ln 8.

Anna
That gives the first solution: y squared over two plus y equals three ln|x plus one| plus ln|x| plus two over x, minus one half, minus ln 8. The main steps were separating the variables, using partial fractions, integrating, and then applying the initial condition.

Corey
For the second problem, we’re given x squared y prime plus 3xy equals x to the fourth ln x plus one, with y of one equal to zero. This one is linear in y, so first divide every term by x squared.

Anna
That puts it in the standard form y prime plus P of x times y equals Q of x. Specifically, y prime plus three over x times y equals x squared ln x plus one over x squared. So P of x is three over x, and Q of x is x squared ln x plus one over x squared.

Corey
For a linear equation, the integrating factor is e raised to the integral of P of x. Here that is e to the integral of three over x dx, which becomes e to the three ln x, or x cubed.

Anna
The solution formula is y equals one over the integrating factor times the integral of the integrating factor times Q of x, plus a constant. Multiplying x cubed by Q gives x to the fifth ln x plus x.

Corey
So y equals x to the minus three times the quantity: the integral of x to the fifth ln x dx, plus the integral of x dx, plus C. The second integral is straightforward: x squared over two.

Anna
For the first integral, use integration by parts because it’s a product of x to the fifth and ln x. Choose u equals ln x, so du is one over x dx; choose dv equals x to the fifth dx, so v equals x to the sixth over six.

Corey
Using integral u dv equals uv minus the integral of v du, we get x to the sixth over six times ln x, minus one sixth times the integral of x to the fifth dx. That remaining integral gives x to the sixth over six, so the result is x to the sixth over six ln x minus x to the sixth over thirty-six.

Anna
Putting the integrals together, y equals x to the minus three times the quantity x to the sixth over six ln x, minus x to the sixth over thirty-six, plus x squared over two, plus C.

Corey
Now apply y of one equals zero. At x equals one, ln 1 is zero and every power of one is one, so zero equals minus one over thirty-six, plus one half, plus C. Therefore C is minus seventeen over thirty-six.

Anna
So the second solution is y equals x to the minus three times the quantity x to the sixth over six ln x, minus x to the sixth over thirty-six, plus x squared over two, minus seventeen over thirty-six. The initial condition determines the constant just as it did in the first problem.

Corey
And that’s the contrast between the two methods: in the first equation, we separated the x and y variables and used partial fractions to integrate; in the second, we recognized a linear equation, found its integrating factor, and used integration by parts for the logarithmic term.

Ask anything
We've read this whole study set, so questions about it get the best answers.