Chapter 7: Differential Equations

AP Calculus AB/BC · Updated February 2026 · 18 min read · AP Calculus Past Papers

Differential equations appear throughout science, engineering, and economics. On the AP Calculus exam, they represent a significant portion of the curriculum: slope fields and separation of variables are tested on both AB and BC, while Euler's method and logistic growth are BC-only topics. This chapter covers all differential equation content you need for a 5 on the exam.

7.1 Introduction to Differential Equations

What Is a Differential Equation?

A differential equation (DE) is any equation that contains one or more derivatives of an unknown function. Rather than asking "what is $y$?", a differential equation asks "what function $y$ has this relationship with its own derivative?"

Definition. A differential equation is an equation involving an unknown function and one or more of its derivatives. For example: $$\frac{dy}{dx} = 3x^2, \qquad \frac{dy}{dx} = 2y, \qquad \frac{d^2y}{dx^2} + y = 0.$$

Order and Degree

The order of a differential equation is the highest derivative that appears. The equation $\frac{dy}{dx} = x + y$ is first-order because the highest derivative is $\frac{dy}{dx}$. The equation $\frac{d^2y}{dx^2} + 3\frac{dy}{dx} = 0$ is second-order. On the AP exam, you will work exclusively with first-order equations.

General vs. Particular Solutions

The general solution of a differential equation contains an arbitrary constant $C$ and represents an entire family of curves. For instance, the general solution of $\frac{dy}{dx} = 2x$ is $y = x^2 + C$, which describes infinitely many parabolas, each shifted vertically by a different amount.

A particular solution is obtained by choosing a specific value of $C$, typically determined by an initial condition. If we know that $y(0) = 5$, then $5 = 0^2 + C$, giving $C = 5$ and the particular solution $y = x^2 + 5$.

Initial Value Problems (IVPs)

Definition. An initial value problem consists of a differential equation together with an initial condition $y(x_0) = y_0$. The goal is to find the particular solution satisfying that condition.

Initial value problems appear constantly on the AP exam. You will be given a DE and a point on the solution curve, and you must find the exact function. The general strategy is: solve the DE to obtain the general solution with constant $C$, then substitute the initial condition to determine $C$.

Example 7.1.1. Solve the initial value problem $\frac{dy}{dx} = 6x^2 - 4x + 1$, where $y(1) = 3$.

Solution. Integrate both sides with respect to $x$:

$$y = \int (6x^2 - 4x + 1)\, dx = 2x^3 - 2x^2 + x + C.$$

Apply the initial condition $y(1) = 3$:

$$3 = 2(1)^3 - 2(1)^2 + 1 + C = 2 - 2 + 1 + C = 1 + C.$$

So $C = 2$, and the particular solution is $y = 2x^3 - 2x^2 + x + 2$.

Example 7.1.2. Verify that $y = Ce^{3x}$ is the general solution of $\frac{dy}{dx} = 3y$. Then find the particular solution satisfying $y(0) = 7$.

Solution. Differentiate: $\frac{dy}{dx} = 3Ce^{3x} = 3y$. This confirms the equation is satisfied for every value of $C$.

For the particular solution, apply $y(0) = 7$:

$$7 = Ce^{3(0)} = C \cdot 1 = C.$$

Therefore $C = 7$ and $y = 7e^{3x}$.

7.2 Slope Fields

A slope field (also called a direction field) is a visual representation of a differential equation. At each point $(x, y)$ in the plane, you draw a short line segment whose slope equals $\frac{dy}{dx}$ evaluated at that point. The result is a picture that shows the "flow" of solutions without actually solving the equation.

Definition. A slope field for the differential equation $\frac{dy}{dx} = f(x, y)$ is a collection of short line segments drawn at sample points $(x, y)$, where each segment has slope $f(x, y)$.

Drawing a Slope Field

To construct a slope field by hand:

  1. Choose a grid of sample points, such as all integer pairs $(x, y)$ in a given region.
  2. At each point, compute $f(x, y)$ to get the slope.
  3. Draw a short segment through that point with the computed slope.
  4. Where $f(x, y) = 0$, draw a horizontal segment. Where $f(x, y)$ is undefined, leave the point blank.

Interpreting Slope Fields

Solution curves follow the slope field like water flowing along a current. Key observations to make:

AP Exam Tip: Multiple-choice questions often ask you to match a slope field to its DE. Look for where slopes are zero (set $\frac{dy}{dx} = 0$ and check which points match the horizontal segments) and whether slopes depend on $x$ only, $y$ only, or both.
Example 7.2.1. Sketch the slope field for $\frac{dy}{dx} = x - y$ at the nine points where $x \in \{-1, 0, 1\}$ and $y \in \{-1, 0, 1\}$.

Solution. Compute $f(x, y) = x - y$ at each grid point:

$(x, y)$$(-1, -1)$$(-1, 0)$$(-1, 1)$$(0, -1)$$(0, 0)$$(0, 1)$$(1, -1)$$(1, 0)$$(1, 1)$
Slope$0$$-1$$-2$$1$$0$$-1$$2$$1$$0$

At $(-1,-1)$, $(0,0)$, and $(1,1)$, draw horizontal segments (slope $= 0$). At $(1,-1)$, draw a steeply rising segment (slope $= 2$). At $(-1,1)$, draw a steeply falling segment (slope $= -2$). The segments along the line $y = x$ are all horizontal, confirming that $y = x$ is related to the equilibrium behavior of this DE.

Example 7.2.2. A slope field has the following properties: all segments along the $x$-axis are horizontal, segments above the $x$-axis point downward to the right, and segments below the $x$-axis point upward to the right. Which DE matches this field?

(A) $\frac{dy}{dx} = -y$   (B) $\frac{dy}{dx} = -x$   (C) $\frac{dy}{dx} = x - y$   (D) $\frac{dy}{dx} = y^2$

Solution. Horizontal segments along the $x$-axis mean $\frac{dy}{dx} = 0$ when $y = 0$. This eliminates (B), since $-x \neq 0$ for all $x$, and (D), since $y^2 = 0$ when $y = 0$ but $y^2 \geq 0$ always, so segments below the $x$-axis would also point upward or be horizontal. For (C), at $(1, 0)$ the slope is $1$, which is positive, not zero—so slopes along the $x$-axis are not all zero. Only (A) satisfies all conditions: $\frac{dy}{dx} = -y$ gives slope $0$ on the $x$-axis, negative slopes when $y > 0$, and positive slopes when $y < 0$. The answer is (A).

Direction Field Problem Types on the AP Exam

Direction field (slope field) questions appear in several distinct formats on the AP exam. Mastering each type is essential for earning full credit.

Type 1: Sketching a Slope Field. Given a differential equation $\frac{dy}{dx} = f(x,y)$, draw short line segments at specified grid points. Compute $f(x,y)$ at each point and draw a segment with that slope. This is often worth 2–3 points on a free-response question.
Type 2: Matching a DE to a Slope Field. Given a slope field diagram, identify the correct differential equation from multiple choices. Strategy: check where slopes are zero, check whether slopes depend on $x$ only, $y$ only, or both, and test specific points.
Type 3: Sketching a Solution Curve. Given a slope field and an initial condition, sketch the particular solution curve by following the flow of the line segments. The curve should be tangent to the segments at every point and must pass through the given initial point.
Type 4: Identifying Equilibrium Solutions. An equilibrium solution is a constant solution $y = c$ where $\frac{dy}{dx} = 0$ for all $x$. On a slope field, these appear as horizontal lines of segments. Equilibrium can be stable (nearby solutions approach it) or unstable (nearby solutions diverge from it).
Example 7.2.3 (Sketching a Solution Curve). Consider the slope field for $\frac{dy}{dx} = y(2 - y)$. Sketch the solution curve passing through $(0, 1)$ and describe its long-term behavior.

Solution. First, identify equilibrium solutions by setting $\frac{dy}{dx} = 0$:

$$y(2 - y) = 0 \implies y = 0 \text{ or } y = 2.$$

These are two horizontal equilibrium lines. Note this DE depends only on $y$ (not $x$), so all segments in the same horizontal row have the same slope.

Starting at $(0, 1)$: since $0 < 1 < 2$, the slope is positive and the solution increases. As $y$ approaches 2, $\frac{dy}{dx} \to 0$ and the curve levels off. The solution curve approaches $y = 2$ asymptotically from below. The equilibrium $y = 2$ is stable (solutions near it converge to it), while $y = 0$ is unstable (solutions near it diverge from it).

Example 7.2.4 (Identifying Equilibrium and Stability). For the differential equation $\frac{dy}{dx} = (y - 1)(y - 4)$, find all equilibrium solutions and classify each as stable or unstable.

Solution. Equilibrium: $\frac{dy}{dx} = 0$ when $(y-1)(y-4) = 0$, so $y = 1$ and $y = 4$.

Analyze the sign of $\frac{dy}{dx}$ in each region:

Solutions above and below $y = 1$ both move toward it, so $y = 1$ is stable.

Solutions just below $y = 4$ move toward $y = 1$ (away from $y = 4$), and solutions just above $y = 4$ increase further away. So $y = 4$ is unstable.

Example 7.2.5 (Determining the DE from a Slope Field Description). A slope field has the following properties:

Which differential equation matches? (A) $\frac{dy}{dx} = 3 - y$   (B) $\frac{dy}{dx} = y - 3$   (C) $\frac{dy}{dx} = (3 - y)^2$   (D) $\frac{dy}{dx} = 3 - x$

Solution.

Eliminate (D): slopes depend on $x$, not $y$, so segments in the same column (not row) would have equal slopes—contradicting the described behavior.

Eliminate (C): $(3-y)^2 \geq 0$ always, so slopes can never be negative. But we need negative slopes when $y > 3$.

Test (A) $3 - y$: when $y = 3$, slope $= 0$ (horizontal). When $y > 3$, slope $< 0$ (negative). When $y < 3$, slope $> 0$ (positive). As $|y - 3|$ increases, $|3 - y|$ increases, making slopes steeper. All properties match.

Test (B) $y - 3$: when $y > 3$, slope $> 0$ (positive). This contradicts "segments where $y > 3$ have negative slopes."

The answer is (A).

Interactive slope field for dy/dx = a·x + b·y + c. Adjust a, b, c to see how the slope field changes. Try a=0, b=-1, c=0 for dy/dx = -y, or a=1, b=-1, c=0 for dy/dx = x - y.

7.3 Euler's Method BC Only

Euler's method is a numerical technique for approximating solutions to initial value problems when an exact solution is difficult or impossible to find analytically. The idea is straightforward: starting from the initial point, take small steps along the tangent line to estimate the solution curve.

Euler's Method Algorithm. Given $\frac{dy}{dx} = f(x, y)$ with initial condition $y(x_0) = y_0$ and step size $\Delta x$:
  1. Compute the slope at the current point: $m_n = f(x_n, y_n)$.
  2. Step forward: $x_{n+1} = x_n + \Delta x$.
  3. Update the $y$-value: $y_{n+1} = y_n + m_n \cdot \Delta x$.
  4. Repeat from step 1 using the new point $(x_{n+1}, y_{n+1})$.

Accuracy Considerations

Euler's method is a first-order approximation. Its accuracy depends on the step size $\Delta x$: smaller steps produce better approximations but require more computation. Important points for the AP exam:

Example 7.3.1. Use Euler's method with step size $\Delta x = 0.5$ to approximate $y(2)$, given $\frac{dy}{dx} = x + y$ and $y(0) = 1$.

Solution. We need to step from $x = 0$ to $x = 2$ in steps of $0.5$, requiring 4 iterations.

Step$x_n$$y_n$$f(x_n, y_n) = x_n + y_n$$y_{n+1} = y_n + f \cdot \Delta x$
0$0$$1$$0 + 1 = 1$$1 + 1(0.5) = 1.5$
1$0.5$$1.5$$0.5 + 1.5 = 2$$1.5 + 2(0.5) = 2.5$
2$1.0$$2.5$$1.0 + 2.5 = 3.5$$2.5 + 3.5(0.5) = 4.25$
3$1.5$$4.25$$1.5 + 4.25 = 5.75$$4.25 + 5.75(0.5) = 7.125$

Therefore, $y(2) \approx 7.125$. (The exact solution is $y = 2e^x - x - 1$, giving $y(2) = 2e^2 - 3 \approx 11.78$, illustrating that the large step size introduces significant error.)

Example 7.3.2. Use Euler's method with $\Delta x = 0.1$ and 3 steps to approximate $y(1.3)$, given $\frac{dy}{dx} = 2x$ and $y(1) = 4$.

Solution.

Step$x_n$$y_n$$f(x_n, y_n) = 2x_n$$y_{n+1} = y_n + f \cdot \Delta x$
0$1.0$$4$$2(1.0) = 2$$4 + 2(0.1) = 4.2$
1$1.1$$4.2$$2(1.1) = 2.2$$4.2 + 2.2(0.1) = 4.42$
2$1.2$$4.42$$2(1.2) = 2.4$$4.42 + 2.4(0.1) = 4.66$

So $y(1.3) \approx 4.66$. The exact solution is $y = x^2 + 3$, giving $y(1.3) = 1.69 + 3 = 4.69$. With a small step size, Euler's method is quite close. Since $y'' = 2 > 0$ (concave up), our approximation is an underestimate, consistent with the result.

Example 7.3.3. Use Euler's method with $\Delta x = 0.5$ to approximate $y(2)$, given $\frac{dy}{dx} = -y$ and $y(0) = 4$. Determine whether the approximation is an overestimate or underestimate.

Solution.

Step$x_n$$y_n$$f(x_n, y_n) = -y_n$$y_{n+1} = y_n + f \cdot \Delta x$
0$0$$4$$-4$$4 + (-4)(0.5) = 2$
1$0.5$$2$$-2$$2 + (-2)(0.5) = 1$
2$1.0$$1$$-1$$1 + (-1)(0.5) = 0.5$
3$1.5$$0.5$$-0.5$$0.5 + (-0.5)(0.5) = 0.25$

Euler's approximation: $y(2) \approx 0.25$. The exact solution is $y = 4e^{-x}$, giving $y(2) = 4e^{-2} \approx 0.541$.

Since $\frac{d^2y}{dx^2} = y > 0$ (the solution curve is concave up), the tangent line lies below the curve, so Euler's method underestimates the true value. Indeed, $0.25 < 0.541$.

Euler's method for dy/dx = f(x,y). The blue curve shows the exact solution y = y₀·e^(kx), while the red step function shows Euler's approximation. Adjust the step size Δx to see how accuracy improves with smaller steps.

7.4 Separation of Variables

Separation of variables is the primary analytical technique for solving first-order differential equations on the AP exam. It works when the DE can be written so that all $y$-terms are on one side and all $x$-terms are on the other.

Method: Separation of Variables. To solve $\frac{dy}{dx} = g(x) \cdot h(y)$:
  1. Separate: Rewrite as $\frac{1}{h(y)}\, dy = g(x)\, dx$.
  2. Integrate: $\displaystyle\int \frac{1}{h(y)}\, dy = \int g(x)\, dx$.
  3. Solve for $y$: Simplify and solve for $y$ if possible.
  4. Apply initial condition: Substitute the given point to find $C$.
AP Exam Tip: Separation of variables is the most frequently tested DE technique. Expect at least one free-response question that requires it. Always check whether the DE is separable before attempting other methods. Remember to include $+C$ on only one side when integrating.
Example 7.4.1 (Basic). Solve $\frac{dy}{dx} = \frac{x^2}{y}$, given $y(0) = 3$.

Solution. Separate variables:

$$y\, dy = x^2\, dx.$$

Integrate both sides:

$$\int y\, dy = \int x^2\, dx \implies \frac{y^2}{2} = \frac{x^3}{3} + C.$$

Apply $y(0) = 3$: $\frac{9}{2} = 0 + C$, so $C = \frac{9}{2}$.

$$\frac{y^2}{2} = \frac{x^3}{3} + \frac{9}{2} \implies y^2 = \frac{2x^3}{3} + 9.$$

Since $y(0) = 3 > 0$, we take the positive root: $y = \sqrt{\dfrac{2x^3}{3} + 9}$.

Example 7.4.2 (Exponential Growth/Decay). Solve $\frac{dy}{dt} = -0.05y$, given $y(0) = 200$.

Solution. Separate variables:

$$\frac{1}{y}\, dy = -0.05\, dt.$$

Integrate:

$$\ln|y| = -0.05t + C_1.$$

Exponentiate both sides:

$$|y| = e^{C_1} e^{-0.05t} \implies y = Ae^{-0.05t}, \quad \text{where } A = \pm e^{C_1}.$$

Apply $y(0) = 200$: $200 = Ae^{0} = A$.

Therefore $y = 200e^{-0.05t}$. This represents exponential decay with rate constant $k = -0.05$.

Example 7.4.3 (Non-linear Separable). Solve $\frac{dy}{dx} = \frac{y^2(1 + x)}{x}$ for $x > 0$, given $y(1) = -1$.

Solution. Separate variables:

$$\frac{1}{y^2}\, dy = \frac{1 + x}{x}\, dx = \left(\frac{1}{x} + 1\right) dx.$$

Integrate both sides:

$$\int y^{-2}\, dy = \int \left(\frac{1}{x} + 1\right) dx \implies -\frac{1}{y} = \ln x + x + C.$$

Apply $y(1) = -1$: $-\frac{1}{-1} = \ln 1 + 1 + C \implies 1 = 0 + 1 + C$, so $C = 0$.

$$-\frac{1}{y} = \ln x + x \implies y = \frac{-1}{\ln x + x}.$$

7.5 Exponential Growth and Decay

The most important differential equation in applications is the exponential model. It arises whenever the rate of change of a quantity is proportional to the quantity itself.

Exponential Growth/Decay Model. If $\frac{dy}{dt} = ky$ and $y(0) = y_0$, then the solution is: $$y = y_0 e^{kt}.$$

This result follows directly from separation of variables (as shown in Example 7.4.2) and is worth memorizing. On the AP exam, you may be asked to derive it or simply apply it to word problems.

Exponential growth and decay: y = y₀·e^(kt). Adjust k (positive = growth, negative = decay) and y₀ to explore solutions of dy/dt = ky.

Common Applications

Example 7.5.1 (Population Doubling). A bacterial colony doubles every 3 hours. If the initial population is 500, find the population after 8 hours.

Solution. The population satisfies $P(t) = 500e^{kt}$. The doubling condition gives:

$$1000 = 500e^{3k} \implies 2 = e^{3k} \implies k = \frac{\ln 2}{3}.$$

After 8 hours:

$$P(8) = 500e^{8 \cdot \frac{\ln 2}{3}} = 500 \cdot 2^{8/3} = 500 \cdot 2^{2.667} \approx 500 \cdot 6.35 \approx 3175.$$

The colony has approximately 3175 bacteria after 8 hours.

Example 7.5.2 (Half-Life). A radioactive isotope has a half-life of 12 years. If a sample initially contains 80 grams, how much remains after 20 years?

Solution. From the half-life: $\lambda = \frac{\ln 2}{12}$, so $A(t) = 80e^{-\frac{\ln 2}{12}t}$.

Equivalently, $A(t) = 80 \cdot 2^{-t/12}$. After 20 years:

$$A(20) = 80 \cdot 2^{-20/12} = 80 \cdot 2^{-5/3} \approx 80 \cdot 0.3150 \approx 25.2 \text{ grams}.$$

Approximately 25.2 grams remain after 20 years. Notice that after 12 years we'd have 40 g, and after 24 years we'd have 20 g, so 25.2 g at 20 years is reasonable.

7.6 Logistic Growth BC Only

Exponential growth is unrealistic for most real populations because it ignores resource limitations. The logistic model improves on this by introducing a carrying capacity $L$—the maximum sustainable population.

Logistic Growth Model. The logistic differential equation is: $$\frac{dP}{dt} = kP\left(1 - \frac{P}{L}\right),$$ where $k$ is the growth rate constant and $L$ is the carrying capacity. The solution is: $$P(t) = \frac{L}{1 + Ae^{-kt}}, \qquad A = \frac{L - P_0}{P_0}.$$

Key Properties of Logistic Growth

AP Exam Tip: You are not expected to derive the logistic solution formula on the BC exam, but you must understand the differential equation and its qualitative behavior. Common questions ask: at what population is growth fastest? (Answer: $P = L/2$.) What is the long-term behavior? (Answer: $P \to L$.)
Example 7.6.1. A fish population in a lake satisfies $\frac{dP}{dt} = 0.4P\left(1 - \frac{P}{5000}\right)$, with $P(0) = 800$.

(a) What is the carrying capacity?

(b) At what population is the growth rate greatest?

(c) Find $P(t)$.

Solution.

(a) Comparing with the standard form, $L = 5000$. The lake can sustain at most 5000 fish.

(b) The growth rate is maximized when $P = L/2 = 2500$ fish.

(c) We have $k = 0.4$, $L = 5000$, $P_0 = 800$. Compute $A$:

$$A = \frac{L - P_0}{P_0} = \frac{5000 - 800}{800} = \frac{4200}{800} = 5.25.$$

Therefore:

$$P(t) = \frac{5000}{1 + 5.25\, e^{-0.4t}}.$$

As $t \to \infty$, $e^{-0.4t} \to 0$, so $P(t) \to 5000$, confirming the population approaches the carrying capacity.

Logistic growth: P(t) = L/(1 + Ae^(-kt)). Adjust the carrying capacity L and growth rate k to see how the population approaches its limit.

7.7 Classifying Differential Equations ★ Special Topic

★ Special Topic — Beyond Standard AP Curriculum

The classification of differential equations as linear vs. nonlinear and homogeneous vs. nonhomogeneous is not explicitly tested on the AP Calculus AB or BC exam. However, this framework is the foundation of every university-level ODE course. Understanding it now will give you a major head start and explain why certain solution methods (like separation of variables) apply to some equations but not others.

Part 1 — Linear vs. Nonlinear Differential Equations

Definition: Linear First-Order ODE. A first-order differential equation is called linear if it can be written in the form $$\frac{dy}{dx} + P(x)\,y = Q(x)$$ where $P(x)$ and $Q(x)$ are functions of $x$ only (not of $y$). If the equation cannot be put in this form, it is called nonlinear.

The word "linear" here refers to how $y$ appears in the equation—$y$ and its derivative must occur to the first power and must not be multiplied together. Coefficients like $P(x)$ and $Q(x)$ may be arbitrarily complicated functions of $x$, and that does not affect linearity.

The Three-Question Test for Linearity

Before writing the equation in standard form, ask three questions about how $y$ appears:

  1. Is $y$ raised to a power other than 1? (e.g., $y^2$, $\sqrt{y}$, $y^{-1}$) → Nonlinear
  2. Is $y$ inside a function? (e.g., $\sin y$, $e^y$, $\ln y$) → Nonlinear
  3. Is $y$ multiplied by its own derivative? (e.g., $y\,\frac{dy}{dx}$) → Nonlinear

If all three answers are "No," the equation is linear (provided you can isolate $\frac{dy}{dx}$ and match the standard form).

Key Distinction: The coefficient of $y$ can be any function of $x$ — that never causes nonlinearity. Only the way $y$ itself appears matters. So $\sin(x)\cdot y$ is fine (linear), but $\sin(y)$ is not (nonlinear).
Example 7.7.1. Classify each equation as linear or nonlinear.

(a) $\dfrac{dy}{dx} + 4xy = e^x$   (b) $\dfrac{dy}{dx} = y^2 - x$   (c) $\dfrac{dy}{dx} + y\cos x = 0$   (d) $y\,\dfrac{dy}{dx} = x^2$

Solution.

(a) The equation is already in standard form with $P(x) = 4x$ and $Q(x) = e^x$. $y$ appears only to the first power. LINEAR

(b) The right side contains $y^2$ — $y$ is squared. This violates the first test. NONLINEAR

(c) Rewrite: $\dfrac{dy}{dx} + (\cos x)\,y = 0$. This has $P(x) = \cos x$ and $Q(x) = 0$. The $\cos x$ is a coefficient of $y$, not an argument; $y$ appears to the first power. LINEAR

(d) The left side has $y \cdot \dfrac{dy}{dx}$ — a product of $y$ with its own derivative. This violates the third test. NONLINEAR

Example 7.7.2. Is $\dfrac{dy}{dx} = e^x \cdot y$ linear?

Solution. Rewrite: $\dfrac{dy}{dx} - e^x y = 0$. Now $P(x) = -e^x$ and $Q(x) = 0$. The exponential $e^x$ is a coefficient of $y$, and $y$ appears to the first power. LINEAR

Compare this carefully with $\dfrac{dy}{dx} = e^y$, where $y$ is in the exponent. That equation is NONLINEAR because $y$ appears inside an exponential function.

Example 7.7.3. Classify $\left(x^2 + 1\right)\dfrac{dy}{dx} - 3xy = x$.

Solution. Divide every term by $(x^2 + 1)$: $$\frac{dy}{dx} - \frac{3x}{x^2+1}\,y = \frac{x}{x^2+1}.$$ This is standard form with $P(x) = -\dfrac{3x}{x^2+1}$ and $Q(x) = \dfrac{x}{x^2+1}$. Although the coefficients are complicated, $y$ appears only to the first power. LINEAR

Example 7.7.4. Classify $\dfrac{dy}{dx} = xy^2 - y$.

Solution. Try to rearrange into standard form: $$\frac{dy}{dx} + y = xy^2.$$ The right side is $xy^2$, which contains $y^2$. There is no algebraic manipulation that removes $y^2$. NONLINEAR

This equation is a Bernoulli equation — a special nonlinear type solvable by a substitution $v = y^{1-n}$. You will encounter this in a university ODE course.

Example 7.7.5. Classify $\dfrac{dy}{dx} = \sin(x)\cdot y - x^2$.

Solution. Rewrite: $\dfrac{dy}{dx} - \sin(x)\,y = -x^2$. Standard form with $P(x) = -\sin x$ and $Q(x) = -x^2$. $y$ appears once, to the first power, as part of the coefficient term $-\sin(x)\cdot y$. LINEAR

Example 7.7.6 (Tricky). Is $\sqrt{x}\,\dfrac{dy}{dx} + \dfrac{1}{\sqrt{x}}\,y = x$ linear?

Solution. Divide by $\sqrt{x}$: $$\frac{dy}{dx} + \frac{1}{x}\,y = \sqrt{x}.$$ Standard form with $P(x) = \dfrac{1}{x}$ (defined for $x > 0$) and $Q(x) = \sqrt{x}$. The complicated-looking $\sqrt{x}$ factors are all functions of $x$ only. LINEAR

Part 2 — Homogeneous vs. Nonhomogeneous Linear DEs

Once we know an equation is linear and write it in standard form $\dfrac{dy}{dx} + P(x)\,y = Q(x)$, we make a second classification based on the right-hand side $Q(x)$.

Definition. A linear ODE $\dfrac{dy}{dx} + P(x)\,y = Q(x)$ is called

Intuitively, a homogeneous equation has "no forcing term" — the system evolves purely under its own internal law. A nonhomogeneous equation has an external "input" or "source" on the right side.

Example 7.7.7. Classify each linear equation as homogeneous or nonhomogeneous.

(a) $\dfrac{dy}{dx} + 3y = 0$   (b) $\dfrac{dy}{dx} - 2y = e^x$   (c) $\dfrac{dy}{dx} + \dfrac{y}{x} = \ln x$   (d) $\dfrac{dy}{dx} - ky = 0$

Solution.

(a) $Q(x) = 0$. HOMOGENEOUS. General solution: $y = Ce^{-3x}$.

(b) $Q(x) = e^x \neq 0$. NONHOMOGENEOUS. Requires an integrating factor or undetermined coefficients to solve.

(c) $Q(x) = \ln x \neq 0$ (for $x > 0$). NONHOMOGENEOUS.

(d) $Q(x) = 0$. HOMOGENEOUS. This is exactly the exponential growth/decay equation — its solution $y = Ce^{kx}$ is already familiar from Section 7.5.

Example 7.7.8. Determine whether $x\,\dfrac{dy}{dx} = 5x - 2y$ is homogeneous or nonhomogeneous.

Solution. First check linearity. Rewrite:

$$x\,\frac{dy}{dx} + 2y = 5x.$$

Divide by $x$ (assuming $x \neq 0$):

$$\frac{dy}{dx} + \frac{2}{x}\,y = 5.$$

$P(x) = \dfrac{2}{x}$, $Q(x) = 5 \neq 0$. The equation is linear and NONHOMOGENEOUS.

⚠ Warning: The Word "Homogeneous" Has Two Different Meanings!

This is one of the most common sources of confusion in differential equations:

Meaning 1 (for linear DEs): $Q(x) = 0$. Example: $\dfrac{dy}{dx} + 3y = 0$ is homogeneous.

Meaning 2 (for nonlinear DEs — a completely separate concept): A nonlinear equation $\dfrac{dy}{dx} = f(x,y)$ where $f$ depends only on the ratio $y/x$ is also called "homogeneous" (degree-based sense). For example, $\dfrac{dy}{dx} = \dfrac{x+y}{x} = 1 + \dfrac{y}{x}$ is "homogeneous" in this second sense — solvable by substituting $v = y/x$.

These two uses of "homogeneous" are completely unrelated. Context tells you which definition applies: if the equation is linear, homogeneous means $Q(x) = 0$. If the equation is nonlinear, homogeneous means it depends only on $y/x$.

Part 3 — Combined Classification and the Full Picture

Every first-order ODE can be placed into this two-axis classification:

Category Standard Form Key Signature AP Solution Method
Linear & Homogeneous $\dfrac{dy}{dx} + P(x)\,y = 0$ Right side is zero; separable Separation of variables → $y = Ce^{-\int P\,dx}$
Linear & Nonhomogeneous $\dfrac{dy}{dx} + P(x)\,y = Q(x)$ Right side $Q(x) \neq 0$ Integrating factor $\mu = e^{\int P\,dx}$ (beyond AP)
Nonlinear & Separable $\dfrac{dy}{dx} = g(x)\,h(y)$ $x$-part times $y$-part Separation of variables (AP Section 7.4)
Nonlinear & Non-separable e.g., $\dfrac{dy}{dx} = x + y^2$ Cannot separate; nonlinear terms Euler's method (numerical, AP Section 7.3); no closed form
Example 7.7.9 (Full Classification). Classify each equation completely (linear/nonlinear, and if linear: homogeneous/nonhomogeneous).

(a) $\dfrac{dy}{dx} = ky$   (b) $\dfrac{dy}{dx} = ky + b$   (c) $\dfrac{dy}{dx} = \dfrac{L - y}{L}\cdot y$   (d) $\dfrac{dy}{dx} + \dfrac{y}{x} = x\sin x$

Solution.

(a) Rewrite: $\dfrac{dy}{dx} - ky = 0$. $y$ appears to the first power, right side zero. Linear, Homogeneous. This is the exponential growth model from Section 7.5. Solution: $y = Ce^{kx}$.

(b) Rewrite: $\dfrac{dy}{dx} - ky = b$ (where $b$ is a nonzero constant). $y$ is linear; right side $Q = b \neq 0$. Linear, Nonhomogeneous. This models growth with a constant input rate $b$. Separation still works here: $\dfrac{dy}{ky+b} = dx$, giving $y = Ce^{kx} - \dfrac{b}{k}$.

(c) Expand: $\dfrac{dy}{dx} = \dfrac{Ly - y^2}{L} = y - \dfrac{y^2}{L}$. The $y^2$ term makes this Nonlinear. (This is the logistic growth equation from Section 7.6, which is separable despite being nonlinear.)

(d) Already in standard form with $P(x) = \dfrac{1}{x}$ and $Q(x) = x\sin x$. No $y^n$ or $f(y)$ terms. Linear, Nonhomogeneous.

Example 7.7.10 (Choosing a Method). For each equation below, identify what solution method applies and why.

(a) $\dfrac{dy}{dx} = \dfrac{x}{y}$   (b) $\dfrac{dy}{dx} + 2y = 4x$   (c) $\dfrac{dy}{dx} = x + y^2$   (d) $\dfrac{dy}{dx} + 3y = 0$

Solution.

(a) $y\,dy = x\,dx$: the equation is separable (nonlinear but separable). Integrate both sides: $\dfrac{y^2}{2} = \dfrac{x^2}{2} + C$, so $y^2 - x^2 = K$. Method: Separation of Variables.

(b) Linear nonhomogeneous. Not directly separable because of the $4x$ term. At AP level, Euler's method estimates solutions numerically. In university, an integrating factor $\mu = e^{2x}$ yields the exact solution $y = 2x - 1 + Ce^{-2x}$. Method: Integrating Factor (university) or Euler's Method (AP).

(c) Nonlinear and non-separable ($x$ and $y^2$ cannot be factored apart). No elementary closed-form solution exists. Method: Euler's Method (numerical approximation) or power series (university).

(d) Linear homogeneous. Also separable: $\dfrac{dy}{y} = -3\,dx \Rightarrow \ln|y| = -3x + C_1 \Rightarrow y = Ce^{-3x}$. Method: Separation of Variables (or direct formula).

Example 7.7.11 (Spotting the Nonlinearity). A student claims that $\dfrac{dy}{dx} = \dfrac{x-y}{x+y}$ is linear because "it's a ratio of linear expressions." Is the student correct?

Solution. No. To test linearity, we try to rearrange into standard form. Multiply both sides by $(x+y)$:

$$(x+y)\,\frac{dy}{dx} = x - y.$$

The left side contains $y\cdot\dfrac{dy}{dx}$, which is a product of $y$ with its derivative — a violation of the third linearity test. The equation is NONLINEAR.

Note: This equation is actually a "degree-0 homogeneous nonlinear DE" (in the second sense of homogeneous). Substituting $v = y/x$ separates it into a solvable form — a technique studied in university ODE courses.

Example 7.7.12 (Second-Order Preview). The same classification extends to second-order equations. Is $y'' + 3y' - 4y = \sin x$ linear or nonlinear? Homogeneous or nonhomogeneous?

Solution. The general form of a linear second-order ODE is $a(x)y'' + b(x)y' + c(x)y = f(x)$. Here $a = 1$, $b = 3$, $c = -4$, and $f(x) = \sin x$. The dependent variable $y$ and its derivatives $y', y''$ appear only to the first power, with no products like $yy'$ or functions like $\sin(y)$. LINEAR.

Since $f(x) = \sin x \neq 0$, this is NONHOMOGENEOUS. This is a key equation type in university-level ODE courses, solved by finding the complementary solution (of $y'' + 3y' - 4y = 0$) plus a particular solution of the full equation.

Why This Matters for AP: On the AP exam, you mostly separate variables or apply formulas directly. But understanding that the exponential growth model $\frac{dy}{dx} = ky$ is linear and homogeneous — and that the logistic model $\frac{dy}{dx} = ky(1-y/L)$ is nonlinear — explains why you can write down the solution to the first from a formula, but must derive the second through careful separation. Classification gives you a roadmap before you start solving.

Quick Reference: 12 Equations Classified

#EquationLinear?If Linear: Homogeneous?Reason / Method
1$y' + 3y = 0$LinearHomo$Q=0$; solution $Ce^{-3x}$
2$y' + 3y = 6$LinearNonhomo$Q=6\ne0$; particular solution $y_p=2$
3$y' = y^2$NonlinearN/A$y^2$ term; separable: $y=-1/(x+C)$
4$y' = e^y$NonlinearN/A$y$ in exponent; separable: $e^{-y}dy=dx$
5$y' = e^x y$LinearHomo$e^x$ is coefficient of $y$; $Q=0$
6$y' - xy = x$LinearNonhomo$Q=x\ne0$; integrating factor method
7$y y' = x$NonlinearN/AProduct $y\cdot y'$; separable: $y^2=x^2+C$
8$y' = \sin(y)$NonlinearN/A$y$ inside $\sin$; separable but not elementary
9$y' + (\sin x)y = 0$LinearHomo$\sin x$ is coefficient; $Q=0$
10$y' + (\sin x)y = \cos x$LinearNonhomo$Q=\cos x\ne0$
11$y' = ky(L-y)$NonlinearN/A$y^2$ term (logistic); separable
12$(1+x^2)y' = y$LinearHomoDivide by $(1+x^2)$: $y'-\frac{y}{1+x^2}=0$

7.8 Practice Problems

Test your understanding with these 18 problems covering all topics from this chapter, including direction fields, Euler's method, separation of variables, and growth models. Click "Show Solution" to check your work. Some problems also touch on the classification ideas from Section 7.7.

Problem 1. Solve the initial value problem $\frac{dy}{dx} = 4x^3 - 6x$, where $y(1) = 2$.

Show Solution

Integrate: $y = \int (4x^3 - 6x)\, dx = x^4 - 3x^2 + C$.

Apply $y(1) = 2$: $2 = 1 - 3 + C = -2 + C$, so $C = 4$.

$y = x^4 - 3x^2 + 4$.

Problem 2. A slope field for $\frac{dy}{dx} = f(x,y)$ has horizontal segments along the line $y = 2x$. Which of the following could be $f(x, y)$?

(A) $x - 2y$   (B) $2x - y$   (C) $y - 2x$   (D) $xy - 2$

Show Solution

Horizontal segments mean $f(x, y) = 0$ along $y = 2x$. Substitute $y = 2x$ into each option:

(A) $x - 2(2x) = x - 4x = -3x \neq 0$ generally.

(B) $2x - 2x = 0$. This works for all $x$.

(C) $2x - 2x = 0$. This also works.

(D) $x(2x) - 2 = 2x^2 - 2 \neq 0$ generally.

Both (B) and (C) give zero on $y = 2x$. However, note that (B) $= 2x - y$ and (C) $= y - 2x = -(2x - y)$, so they produce the same zero set but opposite slopes elsewhere. Either could be correct; on a real AP exam the options would be distinct. The answer is (B) or (C).

Problem 3. Use separation of variables to solve $\frac{dy}{dx} = \frac{2x}{y+1}$, where $y(0) = 1$.

Show Solution

Separate: $(y + 1)\, dy = 2x\, dx$.

Integrate: $\frac{y^2}{2} + y = x^2 + C$.

Apply $y(0) = 1$: $\frac{1}{2} + 1 = 0 + C$, so $C = \frac{3}{2}$.

$\frac{y^2}{2} + y = x^2 + \frac{3}{2}$, or equivalently $y^2 + 2y = 2x^2 + 3$.

Completing the square: $(y + 1)^2 = 2x^2 + 4$, so $y = -1 + \sqrt{2x^2 + 4}$ (taking the positive root since $y(0) = 1 > 0$).

Problem 4 (BC). Use Euler's method with $\Delta x = 0.25$ and two steps to approximate $y(0.5)$, given $\frac{dy}{dx} = y - x$ and $y(0) = 2$.

Show Solution

Step 0: $x_0 = 0$, $y_0 = 2$. Slope $= 2 - 0 = 2$. $y_1 = 2 + 2(0.25) = 2.5$.

Step 1: $x_1 = 0.25$, $y_1 = 2.5$. Slope $= 2.5 - 0.25 = 2.25$. $y_2 = 2.5 + 2.25(0.25) = 3.0625$.

$y(0.5) \approx 3.0625$.

Problem 5. A substance decays according to $\frac{dA}{dt} = -0.03A$. If $A(0) = 500$ grams, how long until 100 grams remain?

Show Solution

$A(t) = 500e^{-0.03t}$. Set $A(t) = 100$:

$100 = 500e^{-0.03t} \implies 0.2 = e^{-0.03t} \implies \ln(0.2) = -0.03t$.

$t = \frac{-\ln(0.2)}{0.03} = \frac{\ln 5}{0.03} \approx \frac{1.6094}{0.03} \approx 53.6$ time units.

Problem 6. Solve $\frac{dy}{dx} = \frac{y}{x}$ for $x > 0$, given $y(1) = 5$.

Show Solution

Separate: $\frac{dy}{y} = \frac{dx}{x}$.

Integrate: $\ln|y| = \ln|x| + C_1$, so $|y| = e^{C_1}|x|$, giving $y = Cx$ where $C = \pm e^{C_1}$.

Apply $y(1) = 5$: $5 = C(1)$, so $C = 5$.

$y = 5x$.

Problem 7. A population of 2000 doubles in 5 years. Assuming exponential growth, what is the population after 12 years?

Show Solution

$P(t) = 2000e^{kt}$. Doubling: $4000 = 2000e^{5k}$, so $k = \frac{\ln 2}{5}$.

$P(12) = 2000e^{12 \cdot \frac{\ln 2}{5}} = 2000 \cdot 2^{12/5} = 2000 \cdot 2^{2.4} \approx 2000 \cdot 5.278 \approx 10{,}556$.

Problem 8. Solve $\frac{dy}{dx} = e^{x-y}$, given $y(0) = 0$.

Show Solution

Rewrite: $\frac{dy}{dx} = e^x \cdot e^{-y}$. Separate: $e^y\, dy = e^x\, dx$.

Integrate: $e^y = e^x + C$.

Apply $y(0) = 0$: $e^0 = e^0 + C \implies 1 = 1 + C$, so $C = 0$.

$e^y = e^x$, so $y = x$.

Verification: $\frac{dy}{dx} = 1$ and $e^{x - y} = e^{x - x} = e^0 = 1$. Confirmed.

Problem 9 (BC). A population satisfies $\frac{dP}{dt} = 0.1P\left(1 - \frac{P}{10000}\right)$ with $P(0) = 1000$. What is the population when the growth rate is at its maximum?

Show Solution

This is a logistic equation with $k = 0.1$ and carrying capacity $L = 10000$.

The growth rate $\frac{dP}{dt}$ is maximized when $P = \frac{L}{2} = 5000$.

At that point, $\frac{dP}{dt} = 0.1(5000)\left(1 - \frac{5000}{10000}\right) = 500 \cdot 0.5 = 250$ individuals per unit time.

Problem 10. A cup of coffee at $90°$C is placed in a room at $20°$C. After 10 minutes, the coffee is at $70°$C. Find the temperature after 30 minutes using Newton's Law of Cooling.

Show Solution

Newton's Law of Cooling: $T(t) = T_s + (T_0 - T_s)e^{kt} = 20 + 70e^{kt}$.

At $t = 10$: $70 = 20 + 70e^{10k}$, so $50 = 70e^{10k}$, giving $e^{10k} = \frac{5}{7}$.

Thus $k = \frac{1}{10}\ln\frac{5}{7} = \frac{1}{10}(\ln 5 - \ln 7) \approx \frac{-0.3365}{10} = -0.03365$.

At $t = 30$:

$T(30) = 20 + 70e^{30k} = 20 + 70\left(e^{10k}\right)^3 = 20 + 70\left(\frac{5}{7}\right)^3 = 20 + 70 \cdot \frac{125}{343}$.

$T(30) = 20 + \frac{8750}{343} \approx 20 + 25.51 \approx 45.5°$C.

Direction Field Problems

Problem 11 (Sketching a Slope Field). Sketch the slope field for $\frac{dy}{dx} = y - x$ at the twelve points where $x \in \{0, 1, 2\}$ and $y \in \{-1, 0, 1, 2\}$. At which points are the slopes zero?

Show Solution

Compute $f(x, y) = y - x$ at each grid point:

$(x, y)$$(0,-1)$$(0,0)$$(0,1)$$(0,2)$$(1,-1)$$(1,0)$$(1,1)$$(1,2)$$(2,-1)$$(2,0)$$(2,1)$$(2,2)$
Slope$-1$$0$$1$$2$$-2$$-1$$0$$1$$-3$$-2$$-1$$0$

The slopes are zero at points where $y = x$: at $(0, 0)$, $(1, 1)$, and $(2, 2)$. These lie along the line $y = x$. Above this line the slopes are positive (solution curves increase), and below it the slopes are negative (solution curves decrease).

Problem 12 (Matching DE to Slope Field). A slope field has these properties: (i) all segments in the same column have the same slope, (ii) slopes are positive for $x < 0$ and negative for $x > 0$, (iii) slopes are zero along the $y$-axis. Which DE matches?

(A) $\frac{dy}{dx} = -x$   (B) $\frac{dy}{dx} = -y$   (C) $\frac{dy}{dx} = x^2$   (D) $\frac{dy}{dx} = -x^2$

Show Solution

Property (i) says slopes depend only on $x$ (same column = same $x$). This eliminates (B), which depends on $y$.

Property (iii) says slope $= 0$ when $x = 0$. Check remaining options: (A) $-0 = 0$ ✓, (C) $0^2 = 0$ ✓, (D) $-0^2 = 0$ ✓.

Property (ii) says slopes are positive when $x < 0$. Check: (A) $-x > 0$ when $x < 0$ ✓, (C) $x^2 > 0$ for all $x \neq 0$ ✗ (positive for both sides), (D) $-x^2 < 0$ for all $x \neq 0$ ✗ (negative for both sides).

The answer is (A).

Problem 13 (Solution Curve on Slope Field). Consider $\frac{dy}{dx} = y(1 - y)$ with initial condition $y(0) = 0.5$.

(a) Find all equilibrium solutions.

(b) Classify each as stable or unstable.

(c) Describe the long-term behavior of the solution through $(0, 0.5)$.

Show Solution

(a) Set $y(1-y) = 0$: equilibrium solutions are $y = 0$ and $y = 1$.

(b) Analyze the sign of $\frac{dy}{dx}$ in each region:

  • $y < 0$: $y < 0$, $(1-y) > 0$, so $\frac{dy}{dx} < 0$. Solutions decrease (move away from $y = 0$).
  • $0 < y < 1$: $y > 0$, $(1-y) > 0$, so $\frac{dy}{dx} > 0$. Solutions increase (move toward $y = 1$).
  • $y > 1$: $y > 0$, $(1-y) < 0$, so $\frac{dy}{dx} < 0$. Solutions decrease (move toward $y = 1$).

$y = 0$ is unstable: solutions just above it move away (upward). $y = 1$ is stable: solutions on both sides converge to it.

(c) Since $0 < 0.5 < 1$, the slope is positive and the solution increases. As $y \to 1$, $\frac{dy}{dx} \to 0$ and the curve levels off. The solution approaches $y = 1$ asymptotically. (This is actually a logistic equation with $L = 1$ and $k = 1$.)

Problem 14 (Determining the DE). From a slope field, you observe: slopes are $0$ along both $y = 0$ and $y = 3$; slopes are positive between $y = 0$ and $y = 3$; slopes are negative when $y < 0$ or $y > 3$; slopes do not depend on $x$. Write a differential equation that could produce this slope field.

Show Solution

We need $\frac{dy}{dx} = f(y)$ (independent of $x$) with zeros at $y = 0$ and $y = 3$.

The simplest such function is $f(y) = y(3 - y)$. Check the signs:

  • $y < 0$: $y < 0$, $(3 - y) > 0$, product $< 0$ ✓
  • $0 < y < 3$: $y > 0$, $(3 - y) > 0$, product $> 0$ ✓
  • $y > 3$: $y > 0$, $(3 - y) < 0$, product $< 0$ ✓

Therefore $\frac{dy}{dx} = y(3 - y)$ matches the described slope field. (Any positive scalar multiple, like $\frac{dy}{dx} = 2y(3-y)$, also works.)

Problem 15 (Slope Field + Particular Solution). The slope field for $\frac{dy}{dx} = 2x - y$ is given.

(a) Sketch the solution curve passing through $(0, -1)$ on the slope field.

(b) Use the slope field to determine whether $y(2)$ is positive or negative for this solution.

(c) Find the equilibrium solution (if any).

Show Solution

(a) At $(0, -1)$: slope $= 0 - (-1) = 1$. The curve starts going upward with slope 1.

At $(0.5, -0.5)$ (approximately): slope $= 1 - (-0.5) = 1.5$. Still increasing steeply.

At $(1, 1)$: slope $= 2 - 1 = 1$. The curve continues to rise.

At $(2, 3)$: slope $= 4 - 3 = 1$. Still positive but the curve is leveling off toward the line $y = 2x - 1$.

(b) Starting from $(0, -1)$ with positive slopes, the solution is increasing. By $x = 1$, the solution is near $y = 1$ (positive). So $y(2)$ is positive.

(c) For an equilibrium solution $y = c$ (constant), we need $\frac{dy}{dx} = 0$ for all $x$: $2x - c = 0$ for all $x$, which is impossible. There is no equilibrium solution. (However, the line $y = 2x - 1$ acts as an "attracting curve" since the general solution approaches it as $x \to \infty$.)

Euler's Method Problems

Problem 16 (BC). Use Euler's method with $\Delta x = 0.1$ and 3 steps to approximate $y(0.3)$, given $\frac{dy}{dx} = x + 2y$ and $y(0) = 1$.

Show Solution
Step$x_n$$y_n$$f(x_n, y_n) = x_n + 2y_n$$y_{n+1}$
0$0$$1$$0 + 2(1) = 2$$1 + 2(0.1) = 1.2$
1$0.1$$1.2$$0.1 + 2(1.2) = 2.5$$1.2 + 2.5(0.1) = 1.45$
2$0.2$$1.45$$0.2 + 2(1.45) = 3.1$$1.45 + 3.1(0.1) = 1.76$

Therefore $y(0.3) \approx 1.76$.

Problem 17 (BC). Consider $\frac{dy}{dx} = 1 - y$ with $y(0) = 0$. Use Euler's method with $\Delta x = 0.5$ and 4 steps to approximate $y(2)$. Then compare with the exact solution.

Show Solution
Step$x_n$$y_n$$f = 1 - y_n$$y_{n+1}$
0$0$$0$$1$$0 + 1(0.5) = 0.5$
1$0.5$$0.5$$0.5$$0.5 + 0.5(0.5) = 0.75$
2$1.0$$0.75$$0.25$$0.75 + 0.25(0.5) = 0.875$
3$1.5$$0.875$$0.125$$0.875 + 0.125(0.5) = 0.9375$

Euler: $y(2) \approx 0.9375$.

Exact: Separate variables in $\frac{dy}{dx} = 1 - y$. Let $u = 1 - y$, then $du = -dy$:

$\int \frac{-du}{u} = \int dx \implies -\ln|1-y| = x + C$. With $y(0) = 0$: $C = 0$.

$y = 1 - e^{-x}$, so $y(2) = 1 - e^{-2} \approx 0.8647$.

Euler's method gives $0.9375$, which is an overestimate. Since $y'' = e^{-x} > 0$ (concave up), we would expect an underestimate—but here the tangent line actually overshoots because the function is approaching the asymptote $y = 1$ from below. The error comes from the large step size $\Delta x = 0.5$.

Problem 18 (BC). The function $y = f(x)$ satisfies $\frac{dy}{dx} = \frac{y}{x}$ with $f(1) = 2$. Use Euler's method with two equal steps to approximate $f(3)$. Is this an overestimate or underestimate? Justify your answer.

Show Solution

Two steps from $x = 1$ to $x = 3$: $\Delta x = \frac{3 - 1}{2} = 1$.

Step$x_n$$y_n$$f = y_n/x_n$$y_{n+1}$
0$1$$2$$2/1 = 2$$2 + 2(1) = 4$
1$2$$4$$4/2 = 2$$4 + 2(1) = 6$

Euler: $f(3) \approx 6$. Exact: $y = 2x$, so $f(3) = 6$. In this case, Euler's method gives the exact answer! This occurs because the exact solution is linear ($y = 2x$), so the tangent line at any point IS the solution curve. Euler's method has zero error for linear solutions regardless of step size.

← Chapter 6: Applications of Integration Chapter 8: Parametric & Polar →