Differential Equations and Slope Fields

When you start learning how to integrate functions, you’ll probably be introduced to the notion of Differential Equations and Slope Fields.

Differential Equations and Separation of Variables

A differential equation is basically any equation that has a derivative in it. For example, a differential equation might include the variables $ x$, $ y$, and the derivative of $ y$ ($ {y}’$ or $ \displaystyle \frac{{dy}}{{dx}}$). Remember the following from the Antiderivatives and Indefinite Integration section:

Definitions of Antiderivative (Integral):

A function $ F$ is an antiderivative of another function $ f$ when $ {F}’\left( x \right)=f\left( x \right)$.

Note that the term indefinite integral is another word for an antiderivative, and is denoted by the integral sign $ \displaystyle \int{.}$

When we have the differential equation (an equation that involve $ x$, $ y$ and the derivative of $ y$) in the form $ \displaystyle \frac{{dy}}{{dx}}=f\left( x \right)$, we can write it as $ dy=f\left( x \right)dx$. When we integrate, we have $ \displaystyle y=\int{{f\left( x \right)dx}}=F\left( x \right)+\,\,C$, where $ C$ is the constant of integration.

But the most important thing to remember is that integration is the opposite of differentiation!

To solve a differential equation, we need to separate the variables so that one variable is on the left-hand side of the equal sign (usually the “$ y$”, including the “$ dy$”), and the other variable is on the right-hand side (usually the “$ x$”, including the “$ dx$”). This is called separation of variables.

At this point, we can integrate on both sides, and put the “$ +\,C$” on the side with the $ x$’s (right away). We will simplify as needed, being careful to preserve the “$ +\,C$” during the simplification. Notice that if we add, subtract, multiply, or divide with the “$ +\,C$” when simplifying, we still end up with a constant $ (+\,C$). This is called the general solution.

Here are some examples:

Differential Equation Problem General Solution
Solve using separation of variables:

 

 

$ \displaystyle \frac{{dy}}{{dx}}=\frac{{{{x}^{2}}+4}}{{2{{y}^{3}}}}$

 

Move everything with a “$ y$” (including the $ dy$) to the left, and everything with an “$ x$” (including the $ dx$) to the right. For this problem, cross-multiply: $ \displaystyle 2{{y}^{3}}dy=\left( {{{x}^{2}}+4} \right)dx$. Now integrate, and put the “$ +\,C$” on the side with the “$ x$”’s. Include the “$ +\,C$” immediately after integrating. Note that we include $ \pm $ because of the even root.

$ \displaystyle \begin{align}\int{{2{{y}^{3}}dy}}&=\int{{\left( {{{x}^{2}}+4} \right)dx}}\\2\cdot \frac{1}{4}{{y}^{4}}&=\frac{1}{3}{{x}^{3}}+4x+C;\,\,\,\,\,\,{{y}^{4}}=\frac{2}{3}{{x}^{3}}+8x+2C\,\,\,\,\,\,\,(\text{which is still }C\text{)}\\y&=\pm \sqrt[4]{{\frac{2}{3}{{x}^{3}}+8x+C}}\,\,\,\,\left( {\times \,\,\frac{{{{3}^{3}}}}{{{{3}^{3}}}}=\pm \frac{1}{3}\sqrt[4]{{54{{x}^{3}}+216x+C}}} \right)\,\,\text{(can}\,\,\text{rationalize)}\end{align}$

Solve using separation of variables:

 

 

$ \displaystyle \frac{1}{{\sqrt{{{{x}^{3}}-1}}}}\frac{{dy}}{{dx}}={{x}^{2}}{{y}^{3}}$

 

which is:

 

$ \displaystyle {{\left( {{{x}^{3}}-1} \right)}^{{-\frac{1}{2}}}}\frac{{dy}}{{dx}}={{x}^{2}}{{y}^{3}}$

Move everything with a “$ y$” (including the $ dy$) to the left, and everything with an “$ x$” (including the $ dx$) to the right. First, multiply both sides by $ dx$: $ \displaystyle {{\left( {{{x}^{3}}-1} \right)}^{{-\frac{1}{2}}}}dy={{x}^{2}}{{y}^{3}}dx$. Then “move” the “$ x$” variables to the right, and “$ y$” to the left by multiplying or dividing on both sides:

$ \displaystyle \frac{{dy}}{{{{y}^{3}}}}=\frac{{{{x}^{2}}dx}}{{{{{\left( {{{x}^{3}}-1} \right)}}^{{-\frac{1}{2}}}}}},\,\,\,\text{or}\,\,\,{{y}^{{-3}}}dy={{\left( {{{x}^{3}}-1} \right)}^{{\frac{1}{2}}}}{{x}^{2}}dx$

Now integrate, and put the “$ +\,C$” on the side with the “$ x$”. Note that we have to use $ u$-sub for the right-hand side. Include $ \pm $ because of the even root.

$ \require {cancel} \displaystyle \begin{align}\int{{{{y}^{{-3}}}dy}}&=\int{{{{{\left( {{{x}^{3}}-1} \right)}}^{{\frac{1}{2}}}}{{x}^{2}}dx}}\\\int{{{{y}^{{-3}}}dy}}&=\int{{{{u}^{{\frac{1}{2}}}}\cancel{{{{x}^{2}}}}}}\frac{{du}}{{3\cancel{{{{x}^{2}}}}}}=\frac{1}{3}\int{{{{u}^{{\frac{1}{2}}}}}}du\end{align}$            $ \displaystyle u={{x}^{3}}-1;\,\,\,du=3{{x}^{2}}dx;\,\,\,dx=\frac{{du}}{{3{{x}^{2}}}}$

 

$ \displaystyle \begin{align}-\frac{1}{2}{{y}^{{-2}}}&=\frac{1}{3}\frac{{{{{\left( {{{x}^{3}}-1} \right)}}^{{\frac{3}{2}}}}}}{{\frac{3}{2}}}+C=\frac{2}{9}{{\left( {{{x}^{3}}-1} \right)}^{{\frac{3}{2}}}}+C\\{{y}^{{-2}}}&=\left( {\frac{2}{9}{{{\left( {{{x}^{3}}-1} \right)}}^{{\frac{3}{2}}}}+C} \right)\cdot -2=-\frac{4}{9}{{\left( {{{x}^{3}}-1} \right)}^{{\frac{3}{2}}}}+-2C\,\,\,\,\,\,\,\,\,\text{(which is still }C\text{)}\\{{\left( {{{y}^{{\cancel{{-2}}}}}} \right)}^{{\cancel{{-\frac{1}{2}}}}}}&={{\left( {-\frac{4}{9}{{{\left( {{{x}^{3}}-1} \right)}}^{{\frac{3}{2}}}}+C} \right)}^{{-\frac{1}{2}}}}\\y&=\pm \frac{1}{{\sqrt{{-\frac{4}{9}{{{\left( {{{x}^{3}}-1} \right)}}^{{\frac{3}{2}}}}+C}}}}\,=\pm \frac{3}{{2\sqrt{{-{{{\left( {{{x}^{3}}-1} \right)}}^{{\frac{3}{2}}}}+C}}}}\,\,\,\,\,\,\,\,\text{(there are many ways to simplify)}\end{align}$

Sometimes we have to solve the differential equation and then put in an initial value to get the $ “C”$ (particular solution). When doing this, it’s best to put in the initial condition immediately after differentiating. Here are some examples; sorry the math is so messy:

Differential Equation Problem Particular Solution
Solve the differential equation

 

$ \displaystyle 10{{y}^{4}}\frac{{dy}}{{dx}}-5{{x}^{5}}=0$,

 

given that the point $ (2,1)$ is on the curve.

Move everything with a “$ y$” (including the $ dy$) to the left, and everything with an “$ x$” (including the $ dx$) to the right. Multiply both sides by $ dx$: $ \displaystyle 10{{y}^{4}}dy=5{{x}^{5}}\,dx$, or $ \displaystyle 2{{y}^{4}}dy={{x}^{5}}\,dx$. Now integrate, and put the “$ +\,C$” on the side with the “$ x$”.

$ \displaystyle \begin{align}\int{{2{{y}^{4}}dy}}&=\int{{{{x}^{5}}\,dx}}\\\frac{2}{5}{{y}^{5}}&=\frac{1}{6}{{x}^{6}}\,+C\end{align}$

Put in initial point $ (2,1)$ to determine “$ C$”:

$ \displaystyle \frac{2}{5}{{\left( 1 \right)}^{5}}=\frac{1}{6}{{\left( 2 \right)}^{6}}\,+C\,\,\,\Rightarrow \,\,\,\,C=\frac{2}{5}-\frac{{32}}{3}=-\frac{{154}}{{15}}$

This equation is $ \displaystyle \frac{2}{5}{{y}^{5}}=\frac{1}{6}{{x}^{6}}\,-\frac{{154}}{{15}}$; solve for $ y$:

$ \displaystyle {{y}^{5}}=\left( {\frac{1}{6}{{x}^{6}}\,-\frac{{154}}{{15}}} \right)\left( {\frac{5}{2}} \right)\Rightarrow y=\sqrt[5]{{\frac{5}{{12}}{{x}^{6}}\,-\frac{{77}}{3}}}=\sqrt[5]{{\frac{5}{{12}}{{x}^{6}}\,-\frac{{308}}{{12}}}}=\sqrt[5]{{\frac{{5{{x}^{6}}\,-308}}{{12}}}}$

Solve the initial value problem using separation of variables:

 

$ \displaystyle y\frac{{dy}}{{dx}}=8\sqrt{{{{{\left( {1+{{y}^{2}}} \right)}}^{3}}}}$

 

$ \displaystyle y\left( 0 \right)=1$

 

Move everything with a “$ y$” (including the $ dy$) to the left, and everything with an “$ x$” (including the $ dx$) to the right. First, multiply both sides by $ dx$: $ \displaystyle y\,dy=8\sqrt{{{{{\left( {1+{{y}^{2}}} \right)}}^{3}}}}dx$, or $ \displaystyle y\,dy=8{{\left( {1+{{y}^{2}}} \right)}^{{\frac{3}{2}}}}dx$. Then “move” everything with a “$ y$” to the left by multiplying on both sides:

$ \displaystyle \begin{align}y\,dy&=8{{\left( {1+{{y}^{2}}} \right)}^{{\frac{3}{2}}}}dx\\\frac{y}{{{{{\left( {1+{{y}^{2}}} \right)}}^{{\frac{3}{2}}}}}}\,dy&=8dx;\,\,\,y\,{{\left( {1+{{y}^{2}}} \right)}^{{-\frac{3}{2}}}}dy=8dx\end{align}$

Now integrate, and put the “$ +\,C$” on the side with the “$ x$”. Use $ u$-sub on the left-hand side:

$ \displaystyle \begin{align}\int{{y\,{{{\left( {1+{{y}^{2}}} \right)}}^{{-\frac{3}{2}}}}dy}}&=\int{{8dx}}\\\int{{\cancel{y}\,{{u}^{{-\frac{3}{2}}}}\cdot \frac{{du}}{{2\cancel{y}}}}}&=\int{{8dx}}\end{align}$            $ \displaystyle u=1+{{y}^{2}};\,\,\,du=2y\,dy;\,\,\,dy=\frac{{du}}{{2y}}$

$ \displaystyle \frac{1}{2}\int{{{{u}^{{-\frac{3}{2}}}}du}}=\int{{8dx}}\,\,\,\,\Rightarrow \,\,\,\frac{1}{2}\frac{{{{u}^{{-\frac{1}{2}}}}}}{{-\frac{1}{2}}}=8x+C\,\,\,\,\Rightarrow \,\,\,-{{\left( {1+{{y}^{2}}} \right)}^{{-\frac{1}{2}}}}=8x+C$

 

Put in initial point $ (0,1)$ to determine “$ C$”. We also rationalized the denominator:

$ \displaystyle -{{\left( {1+{{{\left( 1 \right)}}^{2}}} \right)}^{{-\frac{1}{2}}}}=8\left( 0 \right)+C\,\,\,\Rightarrow \,\,\,\,C=-\frac{1}{{\sqrt{2}}}\cdot \frac{{\sqrt{2}}}{{\sqrt{2}}}=-\frac{{\sqrt{2}}}{2}$

The equation is $ \displaystyle -{{\left( {1+{{y}^{2}}} \right)}^{{-\frac{1}{2}}}}=8x-\frac{{\sqrt{2}}}{2}$; solve for $ y$:

$ \displaystyle -{{\left( {1+{{y}^{2}}} \right)}^{{-\frac{1}{2}}}}=8x-\frac{{\sqrt{2}}}{2}\,\,\Rightarrow 1+{{y}^{2}}={{\left( {-8x+\frac{{\sqrt{2}}}{2}} \right)}^{{-2}}}\,\Rightarrow y=\sqrt{{{{{\left( {-8x+\frac{{\sqrt{2}}}{2}} \right)}}^{{-2}}}-1}}$

Note that we only take the positive square root, since our initial value of $ y$ is positive (1). If our initial value of $ y$ were negative, we’d take the negative square root value.

Here are a couple more likes ones we’ll see in the Exponential Growth Using Calculus section, where we have to set up and solve a differential equation that models a verbal statement:

Differential Equation Problem Solution
The rate of change of $ Q$ with respect to $ t$ is inversely proportional to the cube of $ t$.

 

Write and solve the differential equation that models this situation.

$ \begin{align}\frac{{dQ}}{{dt}}&=\frac{k}{{{{t}^{3}}}};\,\,dQ=k{{t}^{{-3}}}\,dt\\\int{{dQ}}&=\int{{k{{t}^{{-3}}}\,dt}}\\Q&=-\frac{k}{{2{{t}^{2}}}}+C\end{align}$
Solve the differential equation and evaluate the solution at the specified value of the independent variable:

 

The rate of change of $ N$ is proportional to $ 10-t$. When $ t=0,\,\,N=1.5$, and when $ t=1,\,\,N=11$.

 

What is the value of $ N$ when $ t=2$?

$ \displaystyle \begin{align}\frac{{dN}}{{dt}}&=k\left( {10-t} \right)\\dN&=k\left( {10-t} \right)\,dt\\\int{{dN}}&=\int{{k\left( {10-t} \right)\,dt}}\\&=\int{{10k\,dt}}-\int{{kt\,dt}}\\N&=10kt-\frac{1}{2}k{{t}^{2}}+C\end{align}$           $ \displaystyle \begin{array}{c}\text{For point}\,\left( {0,1.5} \right)\text{for}\left( {t,N} \right);\,\text{solve for }C:\\\,\,\,1.5=10k\left( 0 \right)-\frac{1}{2}k{{\left( 0 \right)}^{2}}+C;\,\,\,C=1.5\\N=10kt-\frac{1}{2}k{{t}^{2}}+1.5\\\text{For point}\left( {1,11} \right)\text{for}\left( {t,N} \right);\,\text{solve for }k:\,\\\,11=10k\left( 1 \right)-\frac{1}{2}k{{\left( 1 \right)}^{2}}+1.5\\11=10k-.5k+1.5;\,\,\,k=1\\N=10t-\frac{1}{2}{{t}^{2}}+1.5\end{array}$

 

$ \displaystyle t=2:\,\,\,N=10\left( 2 \right)-\frac{1}{2}{{\left( 2 \right)}^{2}}+1.5;\,\,N=19.5$

Slope Fields

Slope Fields are a strange concept (they look funny!), but they really aren’t that difficult. They are little lines on a coordinate system graph that represent the slope for that $ (x,y)$ combination for a particular differential equation (remember that a differential equation represents a slope). For example, for the differential equation $ \displaystyle \frac{{dy}}{{dx}}=x+y$, for point $ (0,0)$ on the slope field graph, the little line would be horizontal, since $ 0+0=0$, and the slope of 0 is represented by a horizontal line.

Let’s show an example. For differential equation $ \displaystyle \frac{{dx}}{{dy}}=\frac{x}{y},$ the slope is 0 everywhere $ x$ is 0, and is 1 everywhere $ x$ and $ y$ are the same. Also, it is 2 when $ x$ is twice the value of $ y$, 3 when $ x$ is three times the value of $ y$, and so on. The slope is undefined (vertical lines or no lines) when $ y=0$. Thus, here’s a slope field. Again, remember that the little lines represent the slope, since a differential equation is a slope.

Slope Field for:   $ \displaystyle \frac{{dy}}{{dx}}=\frac{x}{y}$

Here are more examples of slope fields. Note that if we solved the differential equation, we’d see the solution to that differential equation in the slope field pattern. For example, for the differential equation $ \displaystyle \frac{{dy}}{{dx}}=2$, the little lines in the slope field graph are $ \displaystyle y=2x$.

Differential Equation Slope Field Graph Solution to Differential Equation
$ \displaystyle \frac{{dy}}{{dx}}=2$ $ \displaystyle \begin{align}dy&=2dx\\\int{{dy}}&=\int{{2dx}}\\y&=2x+C\end{align}$
$ \displaystyle \frac{{dy}}{{dx}}={{x}^{2}}$ $ \displaystyle \begin{align}dy&={{x}^{2}}dx\\\int{{dy}}&=\int{{{{x}^{2}}dx}}\\y&=\frac{{{{x}^{3}}}}{3}+C\end{align}$
$ \displaystyle \frac{{dy}}{{dx}}=\sin x$ $ \displaystyle \begin{align}dy&=\sin x\,dx\\\int{{dy}}&=\int{{\sin x\,dx}}\\y&=-\cos x+C\end{align}$
$ \displaystyle \frac{{dy}}{{dx}}=\frac{1}{{3{{y}^{2}}}}$ $ \displaystyle \begin{align}3{{y}^{{2\,}}}dy&=\,dx\\\int{{3{{y}^{{2\,}}}dy}}&=\int{{dx}}\\{{y}^{3}}&=x+C\\y&=\sqrt[3]{{x+C}}\end{align}$

Here’s a few more that we’ll draw with solution curves, given the solution passes through the given initial points. To draw the solution curves, start with the initial point, and then follow the curve of the little lines as you best can:

Differential Equation Slope Field Graph

$ \displaystyle \frac{{dy}}{{dx}}=\frac{{{{x}^{2}}}}{y}$

 

through point $ \left( {1,1} \right)$

$ \displaystyle \frac{{dy}}{{dx}}=x-y$

 

through point $ \left( {2,1} \right)$

$ \displaystyle \frac{{dy}}{{dx}}=xy$

 

through point $ \left( {0,1} \right)$

Here’s a type of slope field problem you might see:

Slope Field Problem Solution
Which statement is not correct about the drawing of the slope field for:

 

$ \displaystyle \frac{{dy}}{{dx}}=-3y$

 

 a. All of the lines in a particular row are the same.

 b. All of the lines in a particular column are the same.

 c. All lines below the $ x$-axis have a positive slope.

 d. All lines above the $ x$-axis have a negative slope.

 e. There are horizontal lines on the $ x$-axis.

Since the slopes for each $ \displaystyle \frac{{dy}}{{dx}}$ depends on a $ y$ value ($ -3y$) and not an $ x$ value, all the slopes (lines drawn) across a particular row are the same. For negative $ x$ values, the slope is positive (negative times a negative) and for positive $ x$ values, the slope is negative (negative times a positive). The slope values across the row at $ y=0$ are all $ \displaystyle -3\left( 0 \right)=0$ (horizontal lines). 

 

Thus, acd, and e are correct, so the answer is b.

We could also draw the slope field to see this graphically:.

Learn these rules, and practice, practice, practice!

On to L’Hopital’s Rule – you are ready!