If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Separable differential equations

Separation of variables is a common method for solving differential equations. Learn how it's done and why it's called this way.
Separation of variables is a common method for solving differential equations. Let's see how it's done by solving the differential equation dydx=2x3y2:
(1)dydx=2x3y2(2)3y2dydx=2xMultiply by 3y2(3)3y2dy=2xdxMultiply by dx(4)3y2dy=2xdxTake integral(5)y3=x2+CIntegrate(6)y=Ax2+C3Isolate y

Let's review this solution.

In rows (1) to (3) we manipulated the equation so it was in the form f(y)dy=g(x)dx. In other words, we separated x and y so each variable had its own side, including the dx and the dy that formed the derivative expression dydx. This is why the method is called "separation of variables."
In row (4) we took the indefinite integral of each side of the equation. The underlying principle, as always with equations, is that if f(y)dy is equal to g(x)dx, then their indefinite integrals must also be equal.
In rows (5) and (6) we performed the integration with respect to y (on the left-hand side) and with respect to x (on the right-hand side) and then isolated y.
We only added a constant C on the right-hand side. Adding a constant to both sides would be unnecessary, because we can then move one of the constants to the other side and end up with a single constant.
In conclusion, the general solution of dydx=2x3y2 is y=Ax2+C3. You can differentiate y to verify this solution.
Looking back at the equation's solution, notice how the separation of variables that we performed in rows (1) to (3) allowed us to integrate each side and obtain an equation without a derivative.
Problem 1.A
Problem set 1 will walk you through the process of solving this differential equation:
dydx=exy2
How does the equation look after the separation of variables?
Choose 1 answer:

Want to join the conversation?

  • boggle blue style avatar for user Bryan
    How can we say that we're "integrating" both sides, if we're really just adding two long s, then pretending that the dy and dx we're part of the integration operator notation in the first place? How is this valid?

    Also, you're integrating with respects to two different variables. How does this keep the equality?
    (13 votes)
    Default Khan Academy avatar avatar for user
    • cacteye blue style avatar for user Jerry Nilsson
      It's easier to see if we work our way backwards.

      Let 𝑔(𝑦) = 𝑓(𝑥) + 𝐶

      Since these two functions are equal, that implicitly states that 𝑦 is a function of 𝑥, and we can write
      𝑔(ℎ(𝑥)) = 𝑓(𝑥) + 𝐶

      Also, since the functions are equal, the slopes of their tangent lines at any point must also be equal.
      In other words, their derivatives are equal:
      𝑔'(ℎ(𝑥)) ∙ ℎ'(𝑥) = 𝑓 '(𝑥)

      𝑦 = ℎ(𝑥) ⇒ 𝑑𝑦∕𝑑𝑥 = ℎ'(𝑥), and we can write
      𝑔'(𝑦) ∙ 𝑑𝑦∕𝑑𝑥 = 𝑓 '(𝑥)

      Dividing both sides by 𝑔'(𝑦) we get the separable differential equation
      𝑑𝑦∕𝑑𝑥 = 𝑓 '(𝑥)∕𝑔'(𝑦)

      To conclude, a separable equation is basically nothing but the result of implicit differentiation, and to solve it we just reverse that process, namely take the antiderivative of both sides.
      (26 votes)
  • winston baby style avatar for user kungfu303
    How do we know what method to choose to solve a differential equations (whether that be by u-substitution, by parts, or by separating the variables)?
    (6 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Wilson
      Separable equations have dy/dx (or dy/dt) equal to some expression. U-substitution is when you see an expression within another (think of the chain rule) and also see the derivative. For example, 2x/(x^2+1), you can see x^2+1 as an expression within another (1/x) and its derivative(2x). Solving by parts is when you see something you can simplify when deriving or integrating by itself. Usually it is deriving something simple like x, or something you can't integrate easily like ln(x).
      (16 votes)
  • duskpin ultimate style avatar for user Michael Nich
    Why when you take the integral of "y" in the left side there is no C?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • hopper cool style avatar for user Iron Programming
      Whenever we have two constants C1 and C2, we can combine them to form one single constant C.
      At first this may seem like cheating but really all we are saying is C1 and C2 are two mysterious unknown quantities, but we can think of C1 + C2 as 1 mysterious unknown as quantity, and we still haven't changed the value of the equation.

      So given x + C1 = y + C2 we can simplify by writing y = x + C.

      Happy learning! :-)
      (6 votes)
  • blobby green style avatar for user Shehjad Islam
    How do we describe a natural phenomenon through a differential equation? Is there any video about that?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • leaf orange style avatar for user curiousfermions
      The introductory ones in this unit deal with that. Even watering your plants can be written in differential equation! I can not attest it myself but I have heard that university-level physics is all about calculus and physics is basically the part of science that is trying to describe all natural phenomenons.Doing the problems in writing differential equations in this unit will give you a primary idea.
      (6 votes)
  • blobby green style avatar for user jb3154324
    What if the differential equation isn’t separable? How would we find the general/particular solution, y=f(x).

    Also, is implicit integration possible?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user kubleeka
      Differential equations is an entire subfield of mathematics in it's own right. If an equation isn't separable, there are dozens of other techniques you might throw at it.

      Also, yes, if you have an equation, you can integrate both sides, so long as you include a constant of integration on one side.
      (3 votes)
  • male robot donald style avatar for user Viktor Edlund
    In some cases i have been taught that an derivative dy/dx can't be treated as an ratio of the variables dy and dx. But in other cases like this one they are treated just like a ratio. In this example above you can multiply and divide dy and dx. Why is that? I asked my teachers and they say that its not included in the course but im curious.

    kind regards,
    Viktor
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby yellow style avatar for user lily.
    Why do we need to take C into account when solving the equation if it can be any arbitrary constant. Like if the answer should be y=10/(e^x+c), why can't the answer be y=10/(e^x)+c?
    Thank you.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user paxgole
    If I had a step something like: (-y = -x + C), why does it become (y = x + C) and not (y = x - C)?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Mazhar Momin
      If you had a step like: (-y = -x + C),
      let's rewrite this as: (-y) = (-x) + (C)

      Now, let's multiply both the sides by (-1):
      (-1)*(-y) = (-1)*[(-x) + (C)]

      Distributing the (-1) on the R.H.S. gives:
      (-1)*(-y) = [(-1)*(-x)] + [(-1)*(C)]

      Here, the constant (C), when multiplied by (-1) will give another constant; which can be denoted by (C) again.

      In the expression, (-y = -x + C)
      We don't know the value of the constant (C). It can can be either positive or negative. So, multiplying with (-1) can give respective result. It's safe to keep the '+' sign in the original expression intact and the constant (C) in parenthesis.

      Thus,
      y = x + C
      (3 votes)
  • blobby green style avatar for user john harrington
    dy/dx=-xy

    Solve separation of variables
    (1 vote)
    Default Khan Academy avatar avatar for user
    • cacteye blue style avatar for user Jerry Nilsson
      𝑑𝑦∕𝑑𝑥 = −𝑥𝑦

      Multiplying both sides by (1∕𝑦)𝑑𝑥, we get
      (1∕𝑦)𝑑𝑦 = −𝑥𝑑𝑥

      Integrating both sides, we get
      ln |𝑦| = −𝑥²∕2 + 𝐶, where 𝐶 is an arbitrary constant.

      Solving for 𝑦, we get
      𝑦 = ±𝑒^(−𝑥²∕2 + 𝐶) = ±𝑒^(−𝑥²∕2)⋅𝑒^𝐶

      However, because 𝐶 is an arbitrary constant, then ±𝑒^𝐶 is also an arbitrary constant.
      Thus, we can write 𝑦 = 𝐶𝑒^(−𝑥²∕2)
      (3 votes)
  • blobby green style avatar for user davidflores
    what is the porpise of C?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • cacteye green style avatar for user Brandon
      The derivative of "2x + 3" is 2. When we try to reverse this by finding the integral of 2, we initially get "2x". Notice how the "+ 3" is missing? So we need to add C, which is a variable that represents a constant value, giving us the result "2x + C".
      (2 votes)