# Differential Equations

Differential Equations 1

The next several posts will cover the fundamentals of the topic of differential equations at least as far as is needed for an AP Calculus course. We will begin at the beginning.

What is a differential equation?

A differential equation is an equation with one or more derivatives in it. It may be very simple such as $\displaystyle \frac{dy}{dx}=2x$, or more complicated such as $\displaystyle \frac{{{d}^{2}}y}{d{{x}^{2}}}+3\frac{dy}{dx}-4y=\cos \left( x \right)$ or even more complicated.

Why do we need differential equations?

It is often not possible to determine directly a regular function that applies to a real situation. However, we may be able to measure how something is changing with respect to time. The change with respect to time is a derivative and gives us a differential equation. Once in college, as you may remember, there are entire courses devoted to using and solving differential equations. Power series (a BC topic) are often used to approximate or find the solution to a differential equation.

What is the solution to a differential equation?

The solution of a differential equation is not a number. For the first equations we will consider the short answer is that a solution is a function that when substituted into the differential equation along with its derivatives produces a true statement (an identity).

As you may suspect differential equations, at least the easy ones, are solved by integrating. Thus the solution of $\frac{dy}{dx}=2x$  first appears to be $y={{x}^{2}}$. But we quickly realize that $y={{x}^{2}}+17$ and  also $y={{x}^{2}}+2\pi$ check when substituted into the given equation. In fact any equation with the form $y={{x}^{2}}+C$, where C is any constant will check. Because of this we first define the general solution of a differential equation as a function with one or more constants that satisfies the given differential equation.

In order to evaluate the constant(s) we are often given an initial condition. An initial condition is the value of the solution function for a particular value of the independent variable; in other words, a point on the solution’s graph. Once the constant is evaluated we have what’s called a particular solution.

So if the solution of $\frac{dy}{dx}=2x$ contains the point (4, 7), then the particular solution is $y={{x}^{2}}-9$. A differential equation with an initial condition is called an initial value problem or an IVP.

How do you solve a differential equation?

There is no one method that will let you solve any differential equation. They are not all as simple as the example above. That’s why entire courses are devoted to solving differential equations. AP Calculus students are expected to know only one of the many methods. (This is because there is only time for the briefest introduction of the topic.) The method is called separation of variables.Not all differential equations can be solved by this method; the second example at the top for example requires a much different approach (that is not tested on the AP calculus exams).

To use the method of separation of variables follow these steps:

(1) by multiplying and dividing rewrite the equation with the x and dx factors on one side and the y and dy factors on the other side.

(2) Then integrate both sides and

(3) Include a constant of integration.

(4) Use the initial condition to evaluate the constant and

(5) Give the particular solution solved for y.

Example 1: For the very simple example we have been using the work looks like this:

Step 1 Separate the variables: $dy=2xdx$

Steps 2 and 3 Integrate and include the constant of integration. Note that there is a different constant on both sides, but they are immediately combined into one constant that is usually put with the x-terms:$y={{x}^{2}}+C$

Step 4 Use the initial condition to find C$7={{4}^{2}}+C;\quad C=-9$

Stem 5 Write the solution by solving for y$y={{x}^{2}}-9$

Example 2: An average difficulty question. Find the particular solution of the differential equation $\displaystyle \frac{dy}{dx}=-\frac{x}{y}$ such that the point (4, –3) lies on the solution.

Step 1: $ydy=-xdx$

Step 2 and 3: $\displaystyle \frac{1}{2}{{y}^{2}}=-\frac{1}{2}{{x}^{2}}+C$  or ${{y}^{2}}=-{{x}^{2}}+C$.  Multiplying by 2 to simplify things, The constant in the second form is not the same as in the first. However, it is just another constant so it is okay to call it C again.

Step 4: ${{(-3)}^{3}}=-{{\left( 4 \right)}^{2}}+C$ so $C=25$

Step 5: ${{y}^{2}}=-{{x}^{2}}+25$ and $y=-\sqrt{25-{{x}^{2}}}$

Since the solution must be a function it is necessary to solve for y by taking the square root of both sides. The negative sign is chosen because the initial condition requires a negative value for y. The solution is a semi-circle, the bottom half of the full circle.

Example 3: A bit more difficult, but the steps are the same. Find the particular solution of the differential equation $\displaystyle \frac{dy}{dx}=\frac{y-1}{{{x}^{2}}}$ with the initial condition $f\left( 2 \right)=0$. (From the 2008 AB calculus exam question 5c.)

Step 1:$\displaystyle \frac{dy}{y-1}=\frac{dx}{{{x}^{2}}}$

Steps 2 and 3: $\displaystyle \ln \left| y-1 \right|=-\frac{1}{x}+C$

Step 4: When x = 2, y =0  so $\displaystyle \ln \left| 0-1 \right|=-\frac{1}{2}+C;\quad C=\frac{1}{2}$

Step 5: Solve for y: $\displaystyle \ln \left| y-1 \right|=-\frac{1}{x}+\frac{1}{2}$

Raise e to the power on each side to remove the natural logarithm. (Students like to call this “E-ing.”)

$\displaystyle {{e}^{\ln }}^{\left| y-1 \right|}={{e}^{-\frac{1}{x}+\frac{1}{2}}}$

$\displaystyle \left| y-1 \right|={{e}^{-\frac{1}{x}+\frac{1}{2}}}$

Near the initial point (2, 0) $\left( y-1 \right)<0$, so $\left| y-1 \right|=-\left( y-1 \right)=1-y$, so

$\displaystyle 1-y={{e}^{-\frac{1}{x}+\frac{1}{2}}}$

$\displaystyle y=1-{{e}^{-\frac{1}{x}+\frac{1}{2}}}$

The graph of the solution is the part of the graph shown below for which $x>0$. See note 2 below:

Two final notes:

1. The business with the absolute values is important. Students seem to prefer just ignoring the absolute values, but of course you cannot do that. A similar thing occurred in example 2: since you need the square root of one side you must decide, based on the initial condition, whether to use a plus or a minus sign with the radical. Some practice with both these situations is needed.
2. Since $\left( y-1 \right)<0,\quad y<1$. In order to make this so, $x>0$. This is the domain of the solution. Technically, the domain of the particular solution of a differential equation must be an open interval that contains the initial condition, and on which the differential equation is true. Practically, this means that the graph must go through the initial condition point, but may not cross an asymptote or contain a point where the function is not defined. The solution in the example is undefined at x = 0. It approaches the y-axis as a vertical asymptote from the left and approaches the point (0,1) from the right. AP students were not required to sort all this out, but a simple graph of the solution will show what’s happening. For more on the domain (which is not really tested) click here.
3. For you techies: The graph was made on an iPad using an app called Good Grapher Pro. This is an excellent grapher for 2D and 2D graphs that zooms easily by pinching the screen (of course).

## 4 thoughts on “Differential Equations”

1. Justin Dowling says:

I don’t know how to find the domain in many of these. For instance, in the last example why must x>o in order to make y<1 ???

Like

2. Michael Fletcher says:

Lin,
I have found difficulty in explaining when to plug in the initial condition and find C, especially for diffEq’s that result in an exponential function, as it is e^C in one step and C in the other. Is there a rule for when to find C? Is it always found before finding the solution as a function?

Like

• After separating the variables, integrating, and writing the “+ C”, you may substitute the initial condition at any time. Some people like to do it right away and then go on to find the particular solution without ever finding the general solution (unless the general solution is also required). Others prefer to find the general solution first and then substitute to find C and the particular solution. I supposes you can find examples where one method is easier and more efficient and find examples where the other is easier or more efficient. So it’s up to you.

Like