Find a general solution
One equation, many curves
A solution of \(\cy{\frac{dy}{dx}} = 2x\) is a function whose slope is \(2x\) at every input \(x\). The line in the top graph is \(y = 2x\), and the orange heights on it are the slopes at \(x = -1\), \(0.5\) and \(1.5\). The parabola \(y = x^2\) is one solution, because its derivative is \(2x\).
Drag the slider for \(C\). The teal curve in the lower graph is \(y = x^2 + C\), and the faint curves show other values of \(C\). The orange segments on the teal curve have the slopes from the top graph, and they stay tangent to it for every \(C\).
Adding a constant to \(y\) does not change its derivative, so every parabola \(y = x^2 + C\) is a solution. The equation has infinitely many solutions.
A family with one constant
Replace \(2x\) by any function \(f(x)\) with an antiderivative \(F\), so that \(F'(x) = f(x)\).
Drag the slider for \(C\). The teal curve \(y = F(x) + C\) moves up and down, its shape does not change, and the orange segments stay tangent to it.
All the curves have the same slope at each input, so each one is a solution, and only the constant \(C\) tells them apart.
Two solutions of \(\frac{dy}{dx} = f(x)\) have the same derivative, so their difference has derivative 0 on an interval and is a constant. The family \(y = F(x) + C\) therefore holds every solution, and it is the general solution.
Notation
If the right side is the product of a function of \(x\) and a function of \(y\), the equation is separable.
\[\frac{dy}{dx} = f(x)\,g(y)\]Divide by \(g(y)\) and multiply by \(dx\), so that each variable has its own side. The division assumes that \(g(y) \ne 0\).
\[\frac{1}{g(y)}\,dy = f(x)\,dx\]If \(g(c) = 0\), the constant function \(y = c\) is also a solution, which the division can miss.
Integrate the left side with respect to \(y\) and the right side with respect to \(x\). Write one constant \(\cy{C}\).
\[\int \frac{dy}{g(y)} = \int f(x)\,dx + \cy{C}\]Each integral has its own constant, but they combine into one, so one \(C\) is enough.
The general solution contains every solution. It has one arbitrary constant, and each value of \(\cy{C}\) gives one curve.
Solve for y when you can. If you cannot, leave the solution in implicit form, an equation that still contains both x and y.
When it fails
Separation needs a product. In \(\frac{dy}{dx} = x + y\) the right side is a sum, so you cannot move every \(y\) to one side.
The segments turn to the new slopes, and the red dashed curve, which solved the old equation, now cuts across them. The new equation still has solutions, such as the chalk curve that follows the new segments, but separation does not find them.
Example 1: A cube root
Find the general solution of \(\dfrac{dy}{dx} = \dfrac{2x}{y^2}\).
The right side is the product of \(2x\) and \(\frac{1}{y^2}\), so the equation separates. Multiply both sides by \(y^2\) and by \(dx\).
\[y^2\,dy = 2x\,dx\]Integrate each side. Write one constant.
\[\frac{y^3}{3} = x^2 + C\]Multiply both sides by 3. The number \(3C\) is also an arbitrary constant, so call it \(K\).
\[y^3 = 3x^2 + K\]Take the cube root of both sides. Every real number has one real cube root, so you do not choose a sign.
\[y = \sqrt[3]{3x^2 + K}\]
Example 2: A factor of y
Find the general solution of \(\dfrac{dy}{dx} = xy\).
Divide both sides by \(y\) and multiply by \(dx\). This assumes that \(y \ne 0\).
\[\frac{dy}{y} = x\,dx\]A tempting wrong move: Integrate each side. The two sides already match, so leave out the constant.
\[\ln|y| = \frac{x^2}{2}\]This answer holds only the curves \(y = \pm e^{x^2/2}\), such as the red dashed curve. The curve \(y = 3e^{x^2/2}\) also follows the segments, because its derivative is \(x\) times \(y\), but the answer leaves it out.
Write the constant \(C\) on one side. It lets the curve have any height at \(x = 0\).
\[\ln|y| = \frac{x^2}{2} + C\]Exponentiate both sides, because \(e^{\ln|y|} = |y|\). The number \(e^C\) is positive.
\[|y| = e^{C}e^{x^2/2}\]Without the absolute value, \(y = \pm e^{C}e^{x^2/2}\). The constant function \(y = 0\), which the division by \(y\) missed, also solves the equation. One letter \(A\), any real number, covers all three cases.
\[y = Ae^{x^2/2}\]
Practice
Find the general solution of \(\dfrac{dy}{dx} = 4x^3e^{-y}\).
Multiply both sides by \(e^{y}\), so that each side holds one variable. Drag the slider: every curve of the correct formula runs along the segments.
Solution
Multiply both sides by \(e^{y}\) and by \(dx\).
\[e^{y}\,dy = 4x^3\,dx\]Integrate each side. Write one constant.
\[e^{y} = x^4 + C\]Take the natural logarithm of both sides. It is defined where \(x^4 + C > 0\).
\[y = \ln\left(x^4 + C\right)\]
Questions
Questions 1 and 2 use three solutions of \(\frac{dy}{dx} = 3x^2\): the curves \(y = x^3 + C\) for \(C = -2\), 0 and 2.
The orange segments are tangent to the three curves at \(x = 1\). What is the slope of each curve there?
- 3 for every curve
- It depends on \(C\), and a larger \(C\) gives a steeper curve.
- 1 for every curve
- \(-1\), 1 and 3, one for each curve
Answer
3 for every curve
A student writes \(y = x^3\) as the general solution. Which solutions does this answer leave out?
- Every curve with \(C \ne 0\)
- None, because all the curves have the same slopes.
- Only the curves above it
Answer
Every curve with \(C \ne 0\)
Which is the general solution of \(\dfrac{dy}{dx} = \dfrac{y}{x}\) for \(x > 0\)?
- \(y = Ax\)
- \(y = x + C\)
- \(y = \ln x + C\)
- \(y = Ax + B\)
Answer
\(y = Ax\)
Summary
A general solution is a family of curves with one constant, like the parabolas \(y = x^2 + C\), and each value of \(C\) gives one curve.
Every curve has the slope that the equation asks for, and one constant is enough because antiderivatives of a function differ only by a constant.
If the right side is a function of x times a function of y, you separate the variables, integrate each side and write one constant.
This is one of four skills in topic 7.7 of Which & Why: AP Calculus.