Unit 7 · Topic 7.7

Apply an initial condition

Builds on separation of variables and the two tests for a solution. 12 minutes.

  1. Example 1Find a general solution
  2. Example 2Apply the initial condition
  3. Example 3Choose the valid branch and interval
  4. Example 4Use and verify the particular solution

A separable differential equation has the form

\[\frac{dy}{dx}=g(x)\,h(y)\]

where \(g\) depends only on \(x\) and \(h\) depends only on \(y\). Separating the variables and integrating (topic 7.6) gives its general solution, a family of curves with one arbitrary constant. With an initial condition \(y(x_0)=y_0\), which gives the output \(y_0\) at the starting input \(x_0\), the equation becomes an initial value problem (topic 7.2). When \(h(y_0)\neq0\), its solution, the particular solution, is the member of the family that satisfies the condition. This topic finds it, the interval on which it is a solution, and the values it gives.

One point fixes the constant

The slope field of dy/dx = −x/y, whose segments circle the origin, with faint circles about the origin of radius 1, 2 and 3. The x-axis is dashed red, because the equation has no value there. An orange dot marks the starting point (1.8, 2.4). The curve through it is the upper half of the circle of radius 3, and it stops at red rings on the x-axis at x = −3 and x = 3. Two sliders, or dragging, move the dot anywhere within 3 of both axes. Below the axis the curve becomes a lower half circle, and with the dot on the axis no curve is drawn.

Figure 1The segments show the slope field of \(\frac{dy}{dx}=-\frac{x}{y}\), and the faint circles belong to its general solution. The curve through the orange dot is the particular solution. It stops at the red rings on the red dashed \(x\)-axis, where the equation has no value.

In Figure 1, the segments form the slope field of \(\frac{dy}{dx}=-\frac{x}{y}\): each has the slope that the equation gives at its center. Here \(g(x)=-x\) and \(h(y)=\frac{1}{y}\). The equation has no value where \(y=0\), so the \(x\)-axis is a red dashed line. Away from it, multiplying both sides by \(y\,dx\) separates the variables. Integrating each side then gives one constant \(C\) in place of the two constants of integration:

\[\begin{aligned}y\,dy&=-x\,dx\\\frac{y^2}{2}&=-\frac{x^2}{2}+C\end{aligned}\]

Multiplying by 2 and moving \(x^2\) to the left side gives \(x^2+y^2=2C\). For \(C>0\), each curve of the family is therefore a circle about the origin, of radius \(\sqrt{2C}\), and the faint circles are some of them. The orange dot is the starting point \(\cy{(x_0,y_0)}\).

Every solution on which \(h(y)\) is never 0 satisfies the integrated equation with one value of \(C\) along its whole graph. To see why, separate the general equation. Where \(h(y)\neq0\), dividing both sides by \(h(y)\) and multiplying by \(dx\) gives \(\frac{dy}{h(y)}=g(x)\,dx\). Let \(H\) be an antiderivative of \(\frac{1}{h}\) and \(G\) an antiderivative of \(g\), so that integrating each side gives \(H(y)=G(x)+C\). Along such a solution, the chain rule and the equation give

\[\begin{aligned}\frac{d}{dx}H(y)&=\frac{1}{h(y)}\cdot\frac{dy}{dx}\\&=\frac{g(x)\,h(y)}{h(y)}=g(x)\end{aligned}\]

which is also the derivative of \(G(x)\). Two functions with the same derivative on an interval differ by a constant, a corollary of the Mean Value Theorem (topic 6.8). The difference \(H(y)-G(x)\) is therefore one number \(C\) along the solution. The graph passes through the starting point, so \(C=H(y_0)-G(x_0)\). For the circles, \(H(y)=\frac{y^2}{2}\) and \(G(x)=-\frac{x^2}{2}\), so

\[C=\frac{\cy{x_0}^2+\cy{y_0}^2}{2}\]

The condition gives one value of \(C\), so exactly one curve of the family passes through the dot. The dot starts at \((1.8,2.4)\), where \(C=4.5\) and the circle has radius 3. Move the dot with the sliders or by dragging it. The first number under the figure gives \(C\).

Apply the condition after the integration, because the constant \(C\) first appears there. In the differential equation, the starting point gives only the slope \(g(x_0)\,h(y_0)\). Some problems give the family as a formula with a constant, and the condition fixes that constant in the same way. If \(h(y_0)=0\), the constant function \(y=y_0\) solves the problem, because both sides of the equation are 0. The family may not contain it (topic 7.6).

If \(h(y)=1\), the equation is \(\frac{dy}{dx}=g(x)\), and \(H(y)=y\). For a continuous \(g\), the Fundamental Theorem of Calculus, Part 1 (topic 6.4), makes \(G(x)=\int_{x_0}^{x}g(s)\,ds\) an antiderivative of \(g\). At \(x_0\) the two bounds are equal, so \(G(x_0)=0\), and the condition gives \(C=y_0\). The particular solution is therefore \(y=y_0+\int_{x_0}^{x}g(s)\,ds\), even when \(g\) has no antiderivative that you can write.

The branch and the interval

Solving \(x^2+y^2=2C\) for \(y\) gives two functions, \(y=\sqrt{2C-x^2}\) and \(y=-\sqrt{2C-x^2}\). These are the branches of the circle, its upper and lower halves. The solution has the value \(y_0\) at \(x_0\), so it starts on the branch with the sign of \(y_0\).

It cannot cross to the other branch. A solution is differentiable, so it is continuous, and it is never 0, because the equation has no value where \(y=0\). By the Intermediate Value Theorem, a continuous function that changes sign on an interval is 0 somewhere in it. The solution therefore keeps the sign of \(y_0\). Move the dot below the axis. The solution becomes the lower half.

The curve through the dot stops at the red rings, where it meets the \(x\)-axis at \(x=\pm\sqrt{2C}\). Near these points, \(y\) approaches 0 while \(x\) does not, so the slope \(-\frac{x}{y}\) is unbounded and the tangent at each ring is vertical. At the points themselves, the equation has no value. A solution needs a derivative that satisfies the equation at every input of its interval (topic 7.2), so the interval is \(-\sqrt{2C}<x<\sqrt{2C}\). The numbers under the figure give the branch through the dot and its interval. In general, the interval of a particular solution is the largest interval that contains \(x_0\) on which the formula has such a derivative.

Use the button under Figure 1 to put the dot on the \(x\)-axis. The figure then draws no solution, because no solution can start where the equation has no value.

An interval can also end where the equation has a value but the formula does not. In Example 3, the solution has a vertical asymptote at a zero of its denominator. The same happens where a square root would act on a negative number, or a logarithm on a number that is not positive. If the formula has no value at single inputs, such as the zeros of a denominator, its graph splits into pieces there. The solution is the piece that contains the starting point.

Using and checking the particular solution

On its interval, the particular solution gives the value of \(y\) at any input, and the inputs where \(y\) has a given value. Outside the interval, the formula may still give numbers, but they are not values of the solution.

To check a particular solution, use the two tests of topic 7.2. The first test differentiates the formula and compares \(\frac{dy}{dx}\) with \(g(x)\,h(y)\) as expressions in \(x\). The second evaluates the formula at \(x_0\), where it must give \(y_0\). The first test also shows where a formula is no longer a solution, as in Example 4.

Example 1

Find a general solution

Find the general solution of the differential equation \(\dfrac{dy}{dx}=3x^2(y-4)\).

Solution

The right side is \(3x^2\) times \(y-4\), so the equation is separable. Where \(y\neq4\), dividing both sides by \(y-4\) and multiplying by \(dx\) separates the variables. Integrating each side, with one constant for both antiderivatives, gives

\[\begin{aligned}\frac{dy}{y-4}&=3x^2\,dx\\\ln|y-4|&=x^3+C\end{aligned}\]

Because \(e^{\ln|y-4|}=|y-4|\), exponentiating both sides gives \(|y-4|=e^{x^3+C}=e^{C}e^{x^3}\). On an interval where \(y\neq4\), the continuous function \(y-4\) keeps one sign by the Intermediate Value Theorem, so it equals \(e^{C}e^{x^3}\) or \(-e^{C}e^{x^3}\). No solution is 4 at some inputs and not at others. By continuity, at an end of such an interval \(y-4\) equals \(\pm e^{C}e^{x^3}\) too, which is not 0, so the solution never reaches 4. The constant function \(y=4\), which the division left out, also solves the equation, because both sides are 0. One constant \(A\), equal to \(e^{C}\), \(-e^{C}\) or 0, covers the three cases:

\[y=4+Ae^{x^3}\]

Here \(A\) is any real number, and each of these functions is a solution for every \(x\).

Example 2

Apply the initial condition

Find the particular solution of the differential equation \(\dfrac{dy}{dx}=e^{-y}\cos x\) with the initial condition \(y\left(\frac{\pi}{2}\right)=\ln 3\).

Solution

The factor \(e^{-y}\) is never 0, so multiplying both sides by \(e^{y}\) loses no solution. Separating the variables and integrating gives

\[\begin{aligned}e^{y}\,dy&=\cos x\,dx\\e^{y}&=\sin x+C\end{aligned}\]

Apply the condition now, while \(C\) stands alone. Substitute the input \(\frac{\pi}{2}\) for \(x\) and the output \(\ln 3\) for \(y\). Because \(e^{\ln 3}=3\) and \(\sin\frac{\pi}{2}=1\), the equation becomes

\[3=1+C,\qquad C=2\]

Then \(e^{y}=\sin x+2\). Because \(\sin x\ge-1\), the right side is at least 1 for every \(x\), so its natural logarithm is defined everywhere:

\[y=\ln(\sin x+2)\]

Differentiating \(e^{y}=\sin x+2\) gives \(e^{y}\,\frac{dy}{dx}=\cos x\), which is the equation multiplied by \(e^{y}\). The formula is differentiable for every \(x\), so it is a solution on the whole number line.

Example 3

Choose the valid branch and interval

Find the particular solution of \(\dfrac{dy}{dx}=-xy^3\) with \(y(3)=-1\), and give the largest interval on which it is a solution.

Solution

The starting output is not 0, so near the start you can divide by \(y^3\). Separating the variables and integrating gives the first two lines below. The third substitutes \(x=3\) and \(y=-1\):

\[\begin{aligned}\frac{dy}{y^3}&=-x\,dx\\-\frac{1}{2y^2}&=-\frac{x^2}{2}+C\\-\frac12&=-\frac92+C,\quad C=4\end{aligned}\]

Multiplying by \(-2\) gives \(\frac{1}{y^2}=x^2-8\), so \(y^2=\frac{1}{x^2-8}\). This equation has two branches, and the starting output is negative, so

\[y=-\frac{1}{\sqrt{x^2-8}}\]

This formula is never 0, so the division by \(y^3\) holds along the whole solution. It has a value only where \(x^2>8\), on the pieces \(x<-2\sqrt2\) and \(x>2\sqrt2\), and the starting input 3 lies in the second. As \(x\) decreases toward \(2\sqrt2\), \(x^2-8\) approaches 0, so \(y\) decreases without bound, although the equation has a value at every point. The interval is \(x>2\sqrt2\).

Example 4

Use and verify the particular solution

The volume \(V\), in liters, of water in a tank \(t\) minutes after a valve opens satisfies \(\dfrac{dV}{dt}=-4\sqrt V\) with \(V(0)=81\). Verify that \(V=(9-2t)^2\) is the particular solution, and find the time at which the tank holds 49 liters.

Solution

The formula is a polynomial, so it has a derivative at every \(t\). By the chain rule,

\[\begin{aligned}\frac{dV}{dt}&=2(9-2t)\cdot(-2)\\&=-4(9-2t)\end{aligned}\]

On the right side, \(\sqrt V=\sqrt{(9-2t)^2}=|9-2t|\), which equals \(9-2t\) only while \(9-2t\ge0\). The two sides therefore agree for every \(t\le\frac92\), where \(V\) reaches 0 and the tank is empty. After that, \(\frac{dV}{dt}\) is positive and \(-4\sqrt V\) is negative. The condition holds, because \(V(0)=9^2=81\). The model starts at \(t=0\), so the formula is the particular solution for \(0\le t\le\frac92\).

On this interval \(9-2t\ge0\), so \((9-2t)^2=49\) means \(9-2t=7\). The tank holds 49 liters at \(t=1\) minute.

Each example is one of the four skills of topic 7.7 in Which & Why: AP Calculus.