Verify a proposed solution
A differential equation contains the derivative of an unknown function (topic 7.1). This topic writes an equation with only the first derivative as \(\frac{dy}{dx}=F(x,y)\), where \(F(x,y)\) is an expression in \(x\) and \(y\). A solution on an interval \(I\) is a function \(g\) that is differentiable on \(I\) with \(g'(x)=F\big(x,g(x)\big)\) for every \(x\) in \(I\). Its graph then has, at each of its points, the slope that the equation gives there.
This topic tests a proposed solution, called a candidate, and finds the constants and the interval that make it a solution.
The equation at every point
The curve y = x − 1 + 3e to the −x for x from −0.5 to 3.5. It falls from about 3.4 through (0, 2) to a low point near (1.1, 1.1) and then rises. At a movable orange dot, the orange tangent line hides a dashed line with the slope that the equation gives. Below, the dashed curve of the right side lies on the orange curve of the left side, 1 − 3e to the −x. A button changes the candidate to y = 2e to the −x, which also passes through (0, 2) and falls toward 0. Its two lines at the dot separate except at x = 0, and in the lower graph a red band opens between the orange curve −2e to the −x and the dashed curve x − 2e to the −x, closed only at x = 0.
In Figure 1, the curve is the candidate \(g(x)=x-1+3e^{-x}\) for \(\frac{dy}{dx}=x-y\). At the orange dot, the orange tangent line has the slope \(\cy{g'(x)}\) of the candidate, the left side of the equation. The dashed line has the slope that the equation gives at the dot. It is the right side \(x-y\) with \(g(x)\) in place of \(y\), which is \(x-g(x)\). Move the dot with the slider. At every position, the dashed line is hidden under the tangent line, because the two slopes are equal.
Find the left side by differentiating the candidate. Taking it from the equation would assume what the test must show. By the chain rule, the derivative of \(e^{-x}\) is \(-e^{-x}\). To find the right side, substitute the candidate for \(y\):
The candidate is differentiable everywhere, and the two sides are the same expression, so it is a solution on the whole number line. The lower graph plots both sides against \(x\), and a faint dashed line joins the dot to them. The dashed curve of the right side lies on the orange curve of the left side.
Press "Change the candidate". The new candidate \(y=2e^{-x}\) passes through \((0,2)\), as the first one does, but the two lines at the dot separate. Its left side is \(-2e^{-x}\) and its right side is \(x-2e^{-x}\), so the left side minus the right side is \(-x\). In the lower graph, a red band opens between the two curves. Press "Move the dot to x = 0". At \(x=0\) the band closes and the two lines at the dot coincide, because \(-x\) is 0 only there.
A test at \(x=0\) alone would accept this candidate. Every interval contains inputs other than 0, where the two sides differ, so \(y=2e^{-x}\) is not a solution on any interval. One input in the interval where the sides differ rejects a candidate. Equal values at a few inputs prove nothing, because the sides can differ between them. To show that a candidate is a solution, simplify each side by itself. Then compare the two as expressions.
A letter that stands for a fixed number stays a letter in the test. With any constant \(A\) in place of 3, both sides become \(1-Ae^{-x}\), so every function \(x-1+Ae^{-x}\) is a solution. These functions, one for each number \(A\), form a family of solutions. A letter can also be fixed by the test. For \(y=e^{rx}\) and \(\frac{dy}{dx}=2y\), the sides are \(re^{rx}\) and \(2e^{rx}\). They are the same expression when \(r=2\), and for any other \(r\) they differ at every \(x\), because \(e^{rx}\) is never 0.
An equation can also contain the second derivative \(y''\). A solution then needs a second derivative on its interval, and the test differentiates the candidate twice, as in Example 1.
The initial condition and the interval
An initial condition \(y(x_0)=y_0\) gives the output \(y_0\) at the starting input \(x_0\), so the graph of the solution passes through \((x_0,y_0)\). Topic 6.8 used such a condition to pick one antiderivative. An equation with an initial condition is an initial value problem. A candidate solves it on an interval that contains \(x_0\) if it passes two tests: it solves the equation on the interval, and \(g(x_0)=y_0\).
The second test evaluates the candidate at the starting input, without the equation. Either test can pass while the other fails. With the equation of Figure 1 and the condition \(y(0)=2\), every function \(x-1+Ae^{-x}\) passes the first test. The second gives \(-1+Ae^{0}=2\), so only \(A=3\), the candidate of Figure 1, passes both. A solution chosen from a family by an initial condition is called a particular solution. The second candidate of Figure 1, \(y=2e^{-x}\), passes the second test and fails the first. The tests show that a candidate is a solution, but not that it is the only one.
The curve y = 1/(C − x) for x from −1 to 5. It rises toward a red dashed vertical line at x = C and continues, faint, below the axis on the other side. An orange dot marks the starting point (0, 1/2), a dashed orange line marks the curve's value at x = 0, and a red segment joins the curve to the dot unless C is 2. An orange bar on the x-axis runs from the left edge to an open ring at x = C. A button moves the starting point to (4, −1/2): the solid and faint pieces swap, and the bar runs from the ring to the right edge.
In Figure 2, each curve \(y=\frac{1}{C-x}\), with a constant \(C\), is a candidate for \(\frac{dy}{dx}=y^2\). By the chain rule, its left side is \(\frac{1}{(C-x)^2}\), and the right side \(y^2\) becomes the same expression. It therefore passes the first test on any interval that does not contain \(C\). The initial condition is \(y(0)=\frac12\), the orange starting point. Move the slider for \(C\). The dashed orange line marks the candidate's value at \(x=0\), which is \(\frac1C\). The red segment shrinks as \(C\) nears 2, and the numbers under the figure are equal only at \(C=2\).
At \(x=C\) the candidate has no value, so it breaks there, and the red dashed line marks the break. The interval of a solution must contain the starting input, and the solution satisfies the equation at every point of it. The interval therefore cannot contain an input where the candidate, its derivative or the right side has no value. With \(C=2\), the candidate \(y=\frac{1}{2-x}\) solves the problem on \(x<2\), the orange bar, which ends at an open ring. The faint piece beyond the break has the same formula, but it misses the starting point.
Press "Move the start to (4, −½)". The two numbers are equal at the same value \(C=2\), because \(\frac{1}{2-4}=-\frac12\), but the interval is now \(x>2\). The interval depends on the starting input, not only on the formula. In general, it is the largest interval that contains \(x_0\) on which the candidate passes the first test. Its ends are usually such inputs: zeros of a denominator, or ends of the domain of a square root or a logarithm.
Example 1
Differentiate a proposed solution
Let \(y=xe^{-2x}\). Find \(y'\) and \(y''\), and show that \(y\) is a solution of \(y''+4y'+4y=0\).
Solution
The equation contains \(y''\), so differentiate the candidate twice. Its factors \(x\) and \(e^{-2x}\) are differentiable everywhere, so the product rule applies. By the chain rule, the derivative of \(e^{-2x}\) is \(-2e^{-2x}\):
Differentiate \(y'\) in the same way, with \(1-2x\) as the first factor:
Substitute the three expressions into the left side. Then factor out \(e^{-2x}\):
The left side is 0 for every \(x\), so \(y=xe^{-2x}\) is a solution on the whole number line.
Example 2
Check the equation throughout an interval
Is \(y=x^2\) a solution of \(\dfrac{dy}{dx}=x+y\) on the interval \(0<x<4\)?
Solution
The candidate is differentiable everywhere. The left side is its derivative, and the right side has \(x^2\) in place of \(y\):
These are different expressions. The sides are equal only where \(2x=x+x^2\), which means \(x(x-1)=0\), so inside the interval only at \(x=1\). At \(x=3\), which lies in the interval, the left side is 6 and the right side is 12. The equation fails there, so \(y=x^2\) is not a solution on \(0<x<4\).
Example 3
Check the initial condition
Show that \(y=4+5e^{x-2}\) is a solution of the initial value problem \(\dfrac{dy}{dx}=y-4\) with \(y(2)=9\).
Solution
The candidate is differentiable for every \(x\). Its derivative is the left side, and the right side has the candidate in place of \(y\):
The two sides are the same expression, so the candidate solves the equation on the whole number line. The starting input is 2, so evaluate the candidate at \(x=2\), where the exponent \(x-2\) is 0:
This is the starting output, so the candidate passes both tests and solves the initial value problem on the whole number line.
Example 4
Determine a parameter and valid domain
The function \(y=\sqrt{kx+b}\), where \(k\) and \(b\) are constants, is proposed as a solution of \(\dfrac{dy}{dx}=\dfrac{3}{y}\) with \(y(0)=4\). Find \(k\) and \(b\), and the largest interval on which the resulting function is a solution.
Solution
Where \(kx+b>0\), the candidate is differentiable, and the chain rule gives its derivative. The right side has the candidate in place of \(y\):
Multiplied by the positive number \(\sqrt{kx+b}\), the two sides become \(\frac{k}{2}\) and 3. They are equal when \(k=6\), and only then. The equation leaves \(b\) free, and the initial condition fixes it:
The candidate is therefore \(y=\sqrt{6x+16}\). At \(x=-\frac83\) the square root is 0, so the right side \(\frac{3}{y}\) has no value, and for \(x<-\frac83\) the square root has none. The largest interval that contains the starting input 0 and none of these inputs is \(x>-\frac83\).
Each example is one of the four skills of topic 7.2 in Which & Why: AP Calculus.