Educerie

Educerie · AP · Calculus

AP Calculus AB and BC 7.6

Finding General Solutions Using Separation of Variables

How do you go from an equation about the slope to the function itself?

What you will learn

  • Understand that an equation of the form dy ÷ dx = g(x)h(y) can be separated and integrated on both sides
  • Know that the single constant of integration goes on the x side before solving for y
  • Understand that a fraction does not always give a logarithm, so each antiderivative needs choosing
  • Know that the general solution is a family of curves, one for each constant

You must be able to

  1. Write the separated form of a differential equation
  2. Integrate both sides and add one constant of integration
  3. Solve for y in the general solution when possible
  4. Choose between a logarithm, a power and an exponential antiderivative
  5. Check a general solution by differentiating it
  6. Describe a general solution as a family of functions

In the exam. Section I multiple choice: separate and integrate a short equation, pick the right general solution from four, or pick the correct separated form. In Section II, separation of variables is the heart of question 3 (shared by AB and BC), usually with an initial condition (Topic 7.7). Failing to separate the variables, or leaving out the constant of integration, limits the points you can earn. Chief reader reports record equations separated incorrectly, and the initial condition not used before solving.

1The simplest case: only xx on the right

If dydx=f(x)\frac{dy}{dx}=f(x), the solution is an antiderivative.

dydx=6x2⟹y=∫6x2 dx=2x3+C\frac{dy}{dx} = 6x^2 \quad\Longrightarrow\quad y = \int 6x^2\,dx = 2x^3 + C

The constant CC is part of the answer. Each value of CC gives a different curve, and they are all vertical shifts of one another. Together they make the general solution.

2Separation of variables, step by step

An equation is separable if it can be written as

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

Follow these steps.

  1. Separate. Divide by h(y)h(y) and multiply by dxdx: dyh(y)=g(x) dx\dfrac{dy}{h(y)}=g(x)\,dx. The left side now has only yy, the right side only xx.
  2. Integrate both sides. ∫dyh(y)=∫g(x) dx\displaystyle\int\frac{dy}{h(y)}=\int g(x)\,dx.
  3. Add one constant. Write +C+C on one side only, the xx side.
  4. Solve for yy if the question asks and if it is possible.

Why separating is allowed. Treat yy as a function of xx. Dividing dydx=g(x)h(y)\frac{dy}{dx}=g(x)h(y) by h(y)h(y) gives 1h(y)dydx=g(x)\frac{1}{h(y)}\frac{dy}{dx}=g(x). Now integrate both sides with respect to xx. On the left, the chain rule run backwards (substitution with u=yu=y) turns ∫1h(y)dydx dx\int\frac{1}{h(y)}\frac{dy}{dx}\,dx into ∫1h(y) dy\int\frac{1}{h(y)}\,dy. So moving dydy and dxdx to opposite sides is a shorthand for a legitimate substitution, and the result is an equation that links yy and xx with no derivative left in it.

Why one constant is enough: if you wrote a constant on each side, say C1C_1 on the left and C2C_2 on the right, you could move them together into one constant C=C2−C1C=C_2-C_1. So write +C+C once, and do it before any further steps.

Writing the separated form is itself marked. It is the step that earns credit for "separates the variables".

Worked example 1. Find the general solution of dydx=xy\frac{dy}{dx}=xy, for y>0y>0.

Separate:

1y dy=x dx\frac{1}{y}\,dy = x\,dx

Integrate both sides:

ln⁡y=x22+C\ln y = \frac{x^2}{2} + C

Solve for yy, by raising ee to both sides:

y=ex2/2+C=eC ex2/2y = e^{x^2/2+C} = e^{C}\,e^{x^2/2}

The number eCe^C is a positive constant, so rename it AA:

y=Aex2/2y = Ae^{x^2/2}

Check it with Topic 7.2. dydx=Aex2/2⋅x=x⋅y\frac{dy}{dx}=Ae^{x^2/2}\cdot x=x\cdot y. It matches.

For y<0y<0, ln⁡∣y∣=x22+C\ln|y|=\frac{x^2}{2}+C gives y=±eCex2/2y=\pm e^{C}e^{x^2/2}, so AA may be negative too. Writing ln⁡∣y∣\ln|y| with the absolute value keeps both cases. Dividing by yy also lost the solution y=0y=0, which satisfies the equation (both sides are zero). With an initial condition, AA is fixed and these points do not matter.

3Choosing the right antiderivative

The course description warns that students assume that every equation with a fraction has a logarithm in its solution. Some do. Many do not. Check each integral.

  • ∫1y dy=ln⁡∣y∣+C\displaystyle\int\frac{1}{y}\,dy=\ln|y|+C. This is the only common case with 1y\frac1y to the first power.
  • ∫1y2 dy=∫y−2 dy=−1y+C\displaystyle\int\frac{1}{y^2}\,dy=\int y^{-2}\,dy=-\frac1y+C. A power, not a logarithm.
  • ∫3t2 dt=−3t+C\displaystyle\int\frac{3}{t^2}\,dt=-\frac3t+C.

Worked example 2. Find the general solution of dydx=y2cos⁡x\frac{dy}{dx}=y^2\cos x, for y≠0y\ne 0.

1y2 dy=cos⁡x dx⟹−1y=sin⁡x+C\frac{1}{y^2}\,dy = \cos x\,dx \quad\Longrightarrow\quad -\frac1y = \sin x + C

Solve for yy:

1y=−sin⁡x−C⟹y=−1sin⁡x+C\frac1y = -\sin x - C \quad\Longrightarrow\quad y = \frac{-1}{\sin x + C}

Here −C-C became CC again, since the constant is any number. You may write y=−1sin⁡x+Cy=-\dfrac{1}{\sin x+C} or y=1C−sin⁡xy=\dfrac{1}{C-\sin x} and both are correct.

Worked example 3. Find the general solution of dydx=xy2\frac{dy}{dx}=\frac{x}{y^2}.

y2 dy=x dx⟹y33=x22+Cy^2\,dy = x\,dx \quad\Longrightarrow\quad \frac{y^3}{3} = \frac{x^2}{2}+C

Multiply both sides by 33:

y3=3x22+3C⟹y=3x22+C3y^3 = \frac{3x^2}{2} + 3C \quad\Longrightarrow\quad y = \sqrt[3]{\frac{3x^2}{2}+C}

The 3C3C is again any constant, so write it as CC. The same letter is reused when the new constant is still arbitrary. Cube roots have one real value, so there is no ±\pm.

Worked example 4. Find the general solution of dydx=ex−y\frac{dy}{dx}=e^{x-y}.

Rewrite the right side as a product: ex−y=ex⋅e−ye^{x-y}=e^{x}\cdot e^{-y}. Separate:

ey dy=ex dx⟹ey=ex+C⟹y=ln⁡(ex+C)e^{y}\,dy = e^{x}\,dx \quad\Longrightarrow\quad e^{y} = e^{x}+C \quad\Longrightarrow\quad y = \ln\left(e^{x}+C\right)

The constant stays inside the logarithm. It is wrong to write y=x+Cy=x+C.

Worked example 5 (substitution). Find the general solution of dydx=2xyx2+1\frac{dy}{dx}=\frac{2xy}{x^2+1}, for y>0y>0.

1y dy=2xx2+1 dx⟹ln⁡y=ln⁡(x2+1)+C\frac1y\,dy = \frac{2x}{x^2+1}\,dx \quad\Longrightarrow\quad \ln y = \ln\left(x^2+1\right) + C

The right integral uses u=x2+1u=x^2+1 with du=2x dxdu=2x\,dx. Raise ee to both sides:

y=eC(x2+1)=A(x2+1)y = e^{C}\left(x^2+1\right) = A\left(x^2+1\right)

Worked example 6 (a shifted variable). Find the general solution of dydx=y+1x\frac{dy}{dx}=\frac{y+1}{x}, for x>0x>0 and y>−1y>-1.

The right side has y+1y+1 on top and xx below, so it separates with y+1y+1 as the yy part:

1y+1 dy=1x dx  ⟹  ln⁡(y+1)=ln⁡x+C\frac{1}{y+1}\,dy = \frac{1}{x}\,dx \;\Longrightarrow\; \ln(y+1) = \ln x + C

Raise ee to both sides: y+1=eCx=Axy+1=e^{C}x=Ax, so:

y=Ax−1y = Ax - 1

Check by Topic 7.2. dydx=A\frac{dy}{dx}=A, and y+1x=Axx=A\frac{y+1}{x}=\frac{Ax}{x}=A. They match. The family is a set of straight lines through the point (0,−1)(0,-1), one for each slope AA. Notice that the antiderivative of 1y+1\frac{1}{y+1} is ln⁡∣y+1∣\ln|y+1|, not ln⁡∣y∣+1\ln|y|+1. The whole denominator is the argument of the logarithm.

4A family of curves

The general solution is the family of all solutions. Look at dydx=−xy\frac{dy}{dx}=-\frac{x}{y} from Topic 7.2.

y dy=−x dx⟹y22=−x22+C⟹x2+y2=2Cy\,dy = -x\,dx \quad\Longrightarrow\quad \frac{y^2}{2} = -\frac{x^2}{2}+C \quad\Longrightarrow\quad x^2+y^2 = 2C

Rename 2C2C as KK. The solutions are x2+y2=Kx^2+y^2=K: circles about the origin, one for each K>0K>0.

Figure 1. The slope field of dy/dx = -x/y. The general solution x squared plus y squared = C is a family of circles about the origin, and each one runs along the segments −2 −1 0 1 2 −2 −1 0 1 2 y x
Figure 1 · The slope field of dy ÷ dx = -x ÷ y. The general solution x squared plus y squared = C is a family of circles about the origin, and each one runs along the segments

Figure 1 shows the slope field of the equation with two of these circles. Each circle is tangent to the segments it passes through. You can see why: at the point (x,y)(x,y), the radius has slope yx\frac{y}{x}, and the tangent to a circle is perpendicular to the radius, so its slope is −xy-\frac{x}{y}.

A solution that is a function of xx must pass the vertical line test, so each solution is half of a circle: y=K−x2y=\sqrt{K-x^2} or y=−K−x2y=-\sqrt{K-x^2}. Which half depends on the starting point (Topic 7.7).

5When separation does not apply

Not every equation can be separated. dydx=x+y\frac{dy}{dx}=x+y cannot be written as a product of an xx part and a yy part, so this method does not work on it. The equations in this unit are ones you can separate, or ones in the exponential and logistic forms of Topics 7.8 and 7.9. If you cannot see how to separate, try factoring the right side or rewriting a power of ee.

Practice questions

30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.