Two Simple Kinds of Differential Equations
A differential equation may depend on both \(x\) and \(y\), but some equations depend on just one of them. If the derivative depends only on \(x\), finding a solution amounts to finding an antiderivative. If the derivative depends only on \(y\), the equation can be separated and integrated, provided we take care at values where the right-hand side is zero.
These cases are useful for practicing how a general solution is built and how an initial condition selects one member of a family. They also highlight an important issue: dividing by a function of \(y\) can discard constant solutions, so those must be checked separately.
When the Derivative Depends Only on \(x\)
If \(F'(x)=f(x)\) on an interval, then every function of the form \(y=F(x)+C\), where \(C\) is a constant, satisfies \(\frac{dy}{dx}=f(x)\). Conversely, if \(y\) satisfies this equation, then \(y-F\) has derivative zero, so it is constant on the interval. Thus the full family of solutions is an antiderivative plus a constant.
An initial condition \(y(x_0)=y_0\) determines that constant. In terms of any antiderivative \(F\), the solution is \(y=F(x)-F(x_0)+y_0\). This formula works on any interval where \(f\) is defined and the antiderivative exists.
Worked Example: An Initial-Value Problem with \(x\)-Dependence
Solve \(\frac{dy}{dx}=3x^2-4x+1\) with \(y(0)=2\).
First find an antiderivative of the right-hand side:
Use the initial condition. Substituting \(x=0\) and \(y=2\) gives \(2=0-0+0+C\), so \(C=2\). The particular solution is therefore:
Check it by differentiating: \(\frac{dy}{dx}=3x^2-4x+1\), as required. At \(x=0\), the formula gives \(y=2\), so it also satisfies the initial condition.
When the Derivative Depends Only on \(y\)
For \(\frac{dy}{dx}=g(y)\), the dependent variable appears on the right-hand side. On an interval where \(g(y)\ne 0\), separation gives \(\frac{1}{g(y)}\,dy=dx\). Integrating both sides produces a relation between \(y\) and \(x\). That relation may be implicit; it is a solution description when it determines a differentiable function \(y(x)\) on the interval in question.
Here is why the integration works. Suppose \(g(y)\ne 0\) along a solution and define \(G\) by \(G'(y)=1/g(y)\) on the relevant range of \(y\). The chain rule gives:
A function with derivative \(1\) differs from \(x\) by a constant. Therefore \(G(y(x))=x+C\). This establishes the implicit solution relation and explains why the method works. It does not include points where \(g(y)=0\), because \(G'\) as defined here is not available there.
Worked Example: An Autonomous Equation with an Initial Condition
Solve \(\frac{dy}{dx}=y^2-1\) with \(y(0)=0\), and also identify its constant solutions.
First find the constant solutions directly. A constant \(y=c\) has derivative zero, so it solves the equation when \(c^2-1=0\). Factoring gives \((c-1)(c+1)=0\), so \(y=1\) and \(y=-1\) are constant solutions.
For nonconstant solutions with \(y\ne 1\) and \(y\ne -1\), separate variables and use partial fractions:
Integrating gives:
Use \(y(0)=0\). Substitution gives \(\frac{1}{2}\ln|{-1}/{1}|=C\), so \(C=0\). The initial value lies between \(-1\) and \(1\); on that range, \(\left|\frac{y-1}{y+1}\right|=\frac{1-y}{1+y}\). Thus:
Writing \(q=e^{2x}\), multiply by \(1+y\) and rearrange: \(1-y=q+qy\), so \(1-q=y(1+q)\). Hence:
Check the initial condition: at \(x=0\), the numerator is \(1-1=0\) and the denominator is \(1+1=2\), giving \(y(0)=0\). To check the equation, let \(q=e^{2x}\), so \(dq/dx=2q\). Differentiating yields \(\frac{dy}{dx}=-4q/(1+q)^2\). Meanwhile, \(y^2-1=((1-q)^2-(1+q)^2)/(1+q)^2=-4q/(1+q)^2\). The derivative and the right-hand side agree.
Constant Solutions and Division
For \(\frac{dy}{dx}=g(y)\), the constant function \(y=c\) is a solution exactly when \(g(c)=0\). This follows by substituting \(y=c\): its derivative is zero, so the equation requires \(0=g(c)\). There may be no such values, one such value, or several.
For \(\frac{dy}{dx}=f(x)\), a constant function \(y=c\) is a solution on an interval exactly when \(f(x)=0\) throughout that interval. A zero of \(f\) at just one point is not enough; the differential equation must hold at every point of the interval.
Worked Example: A Constant Solution from an Initial Condition
Solve \(\frac{dy}{dx}=0\) with \(y(2)=-3\).
Every antiderivative of zero is a constant, so the general solution is \(y=C\). Applying the initial condition gives \(C=-3\), and the particular solution is \(y=-3\).
Check: differentiating \(y=-3\) gives \(\frac{dy}{dx}=0\), and substituting \(x=2\) gives \(y(2)=-3\). Both the equation and the initial condition hold.
A Common Mistake: Dividing Away a Solution
Consider again \(\frac{dy}{dx}=y^2-1\). A tempting first step is to divide by \(y^2-1\). This produces an equation that is valid only when \(y^2-1\ne0\). If we then claim that the separated equation describes every solution, we have made an error: the constant functions \(y=1\) and \(y=-1\) were excluded by the division.
The correction is to check the zeros of the right-hand side before dividing. Solve \(g(c)=0\) to find the possible constant solutions, then separate and integrate only on intervals where \(g(y)\ne0\). Finally, check any proposed solution in the original differential equation. This procedure respects the condition required for division and prevents constant solutions from being lost.
A Reliable Procedure
If the right-hand side is \(f(x)\), find an antiderivative. If it is \(g(y)\), prepare to separate where \(g(y)\ne0\).
For \(g(y)\), solve \(g(c)=0\). For \(f(x)\), a constant solution requires \(f\) to be zero throughout the interval.
Include a constant of integration, then substitute the given point to determine it. For \(g(y)\), keep track of the interval where division is valid.
Differentiate the proposed solution and substitute it into the original equation. Also check the initial condition when one is given.
Why These Cases Matter
These equations make the distinction between a general solution and a particular solution concrete. Integration produces a family of curves; an initial condition selects a curve from that family. In the autonomous case, examining zeros of \(g\) also reveals constant solutions before separation is attempted.
The essential checks are brief but important: identify where division is legal, include the integration constant, apply the initial condition, and verify by substitution. An implicit relation is acceptable when it describes a differentiable solution on the stated interval; an explicit formula is not always necessary.
Check Your Understanding
For each question, consider both the equation and any conditions needed for the method.
- What is the general solution of \(\frac{dy}{dx}=4x\), and what particular solution satisfies \(y(1)=3\)?
- For \(\frac{dy}{dx}=g(y)\), what equation must a constant solution \(y=c\) satisfy?
- Why must values with \(g(y)=0\) be checked before dividing by \(g(y)\)?
- Is a constant function a solution of \(\frac{dy}{dx}=x-2\) on an interval containing more than one \(x\)-value? Explain.
- What calculation verifies that a proposed function satisfies a differential equation and an initial condition?