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

Worked example: separable differential equations

Two worked examples of finding general solutions to separable differential equations.

Want to join the conversation?

  • aqualine ultimate style avatar for user Stefan van der Waal
    I don't understand what Sal did with the constant in the second example.
    The anti-derivative of sin(x) is -cos(x) + C. After that he multiplies it by -1, and he gets cos(x) + C. Shouldn't that be cos(x) - C?
    (18 votes)
    Default Khan Academy avatar avatar for user
    • mr pink red style avatar for user andrewp18
      Remember, 𝐶 = ℝ. That is, the constant of integration can be any real number. Writing +𝐶 is the same as writing -𝐶 because 𝐶 encapsulates all real numbers. That is, if we fix 𝐶₁ as one possible value of 𝐶, then since {𝐶₁ ∪ -𝐶₁} ∈ ℝ = 𝐶, the sign of the constant of integration does not matter.

      For example, an antiderivative of sin 𝑥 is -cos 𝑥 + 5. Multiplying this by -1 for whatever reason gives us cos 𝑥 – 5. However, another antiderivative of sin 𝑥 is -cos 𝑥 – 5. Multiplying this by -1 gives us cos 𝑥 + 5. So cos 𝑥 ± 5 are both valid results from multiplying antiderivatives of sin 𝑥 by -1. This same logic applies to all real numbers (𝐶) so whether or not we distribute the negative to 𝐶 is irrelevant. It still encapsulates ℝ no matter what its sign is.

      Comment if you have questions!
      (47 votes)
  • starky ultimate style avatar for user Dibya Dey
    Would it be fine if I simplify my answer to y = sec(x) + C?
    (6 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Hassan Khan
    At 1 :48 why Sal is putting c on right hand side only but not with y^2/2. Please explain.
    (5 votes)
    Default Khan Academy avatar avatar for user
    • old spice man green style avatar for user Timothy S. Moran
      Greetings!

      A few videos back, Sal mentioned that if you put C on both sides, then you subtract C from both sides, you simply end up with C on the right side. So, it is a shortcut to simply leave the C off of the Y (left side) of the equation as once you solve for Y, you will only end up with +C on the right side anyway.
      (8 votes)
  • leaf green style avatar for user Abhinay Singh
    I didn't get the idea behind the "general solution" and "Particular solution"
    Could someone help me please
    (5 votes)
    Default Khan Academy avatar avatar for user
    • female robot grace style avatar for user loumast17
      that + C at the end after integrating casues it to be a general solution, since we don't know what the exact solution is. Or maybe another way to think of it is that C can be any number, and if you differentiated it you'd get the exact same answer. think x^2+1, x^2+2 and even just x^2. They all differentiate to 2x.

      It isn't until we have some initial conditions we can figure out what that C is. initial conditions need to be when x is something then y is something else. Then you can plug these into the equation once you have things in terms of y and use algebra to figure out what C is. Does that help?
      (7 votes)
  • blobby green style avatar for user aweosme.noodles
    That was strangely fun Sal, im ecstatic over here
    (6 votes)
    Default Khan Academy avatar avatar for user
  • old spice man blue style avatar for user DJ Daba
    I've heard people say "At , it was A-OK for Sal to keep C as C when multiplying by -1, because C is still just an arbitrary constant."

    That I understand.

    This I do not understand:

    At , Sal takes the reciprocal of both sides. And he puts the C in the denominator. But if you have and arbitrary constant C and you raise it to the -1 power, it'll still be an arbitrary constant!! It's domain hasn't changed.
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user ericgdumont
    Isn't y = 0 also a solution for the 2nd one? It's not given by the general solution he gave.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user S
    In the second example at time can I integrate the y side into ln|y²| * 1/2 ?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • ohnoes default style avatar for user Venice704
    Not a question but is it just me or is this one of the easiest things I've learned in calculus so far? It's really straightforward and makes a lot of intuitive sense
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user stevenluong64
    Let's say for instance you have integral dx by itself. Does it just turn to x? I get confused with the respect to dy or dx when this instance happens. Because the integral dx is not respect to anything
    (1 vote)
    Default Khan Academy avatar avatar for user
    • male robot donald style avatar for user Venkata
      Just so that anyone else with the same doubt gets it clarified, yes, the integral of dx would be x. Similarly, the integral of dy would be y. You can use the reverse power rule here. We can write dx as 1dx and 1 can be written as x^(0)dx. Using the reverse power rule, we get x^(0+1)/1 which is x
      (2 votes)

Video transcript

- [Instructor] What we're gonna be doing in this video is get some practice finding general solutions to separable differential equations. So let's say that I had the differential equation DY, DX, the derivative of Y with respect to X, is equal to E to the X, over Y. See if you can find the general solution to this differential equation. I'm giving you a huge hint. It is a separable differential equation. All right, so when we're dealing with a separable differential equation, what we wanna do is get the Ys and the DYs on one side, and then the Xs and the DXs on the other side. And we really treat these differentials kind of like variables, which is a little hand-wavy with the mathematics. But that's what we will do. So let's see. If we multiply both sides times Y, so we're gonna multiply both sides times Y, what are we going to get? We're gonna get Y times a derivative of Y, with respect to X, is equal to E to the X, and now we can multiply both sides by the differential, DX; multiply both of them by DX; those cancel out. And we are left with Y times DY is equal to E to the X, DX. And now we can take the integral of both sides. So let us do that. So what is the integral of Y, DY? Well here we would just use the reverse power rule. We would increment the exponent, so it's Y to the first, but so now when we take the anti-derivative, it will be Y squared, and then we divide by that incremented exponent, is equal to, well the exciting thing about E to the X is that it's anti-derivative, and its derivative, is E to the X, is equal to E to the X, plus is equal to E to the X plus C. And so we can leave it like this if we like. In fact this right over here is, this isn't an explicit function. Y here isn't an explicit function of X. We could actually say Y is equal to the plus or minus square root of two times all of this business, but this would be a pretty general relationship, which would satisfy this separable differential equation. Let's do another example. So let's say that we have the derivative of Y with respect to X is equal to, let's say it's equal to Y squared times sine of X. Pause the video and see if you can find the general solution here. So once again, we wanna separate our Ys and our Xs. So let's see, we can multiply both sides times Y to the negative two power, Y to the negative two, Y to the negative two, these become one, and then we could also multiply both sides times DX. So if we multiply DX here, those cancel out, and then we multiply DX here, and so we're left with Y to the negative two power times DY is equal to sine of X, DX, and now we just can integrate both sides. Now what is the anti-derivative of Y to the negative two? Well, once again we use the reverse power rule. We increment the exponents, so it's gonna be Y to the negative one, and then we divide by that newly incremented exponent. So we divide by negative one. Well that would just make this think negative. That is going to be equal to... So, what's the anti-derivative of sine of X? Well, it is, you might recognize it if I put a negative there, and a negative there. The anti-derivative of negative sine of X, well that's cosine of X. So this whole thing is gonna be negative cosine of X, or another way to write this: I could multiply both sides times a negative one, and so these would both become positive, and so I could write one over Y is equal to cosine of X, and actually let me write it this way, plus C; don't wanna forget my plus Cs. Plus C, or I could take the reciprocal of both sides if I wanna solve explicitly for Y, I could get Y is equal to one over cosine of X plus C as our general solution. And we're done. That was strangely fun.