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 equations example (old)

An old worked example video of solving separable equations. Created by Sal Khan.

Want to join the conversation?

  • aqualine ultimate style avatar for user Kuba
    At - Why the absolute value of y in ln is necessary ?
    (18 votes)
    Default Khan Academy avatar avatar for user
    • leaf red style avatar for user Leonardo B
      That is an interesting question. In this particular case, the absolute value is not really necessary (Sal explains why from to ). However, in general, when you integrate the function 1/x, it is a good idea to use the absolute value in the result, hence ln|x|.

      Think about it: the original function 1/x has what domain? It is all real numbers except 0. So if you were to say, the antiderivative of 1/x is ln(x) (no absolute value), you're walking into a function that has a more restricted domain (ln is defined only for positive numbers).

      So, by saying that the antiderivative of 1/x is ln|x| (with absolute value), you end up with two functions that share the same domain (you can calculate ln|x| for negative numbers as well).

      You might now ask yourself, is 1/x really the derivative of ln|x| (with the absolute value)? Well, the answer is yes, and you can verify this for yourself. One way is to separate the problem in two: evaluate the derivative of ln(x) for x>0. Then evaluate the derivative of ln(-x) for x<0.

      If you don't know how to evaluate those derivatives, see Sal's excellent video called "Proof: d/dx(ln x) = 1/x", from the Calculus playlist. Have fun!
      (90 votes)
  • leaf green style avatar for user chr.paetzold
    How do I know whether a differential equation is separable?
    (14 votes)
    Default Khan Academy avatar avatar for user
    • old spice man green style avatar for user Hector
      DEFINITION: A differential equation is separable if it is of the form y'=f(x,y) in which f(x,y) splits into a product of two factors, one depending on x alone and the other depending of y alone. Thus each separable equation can be expressed in the form y'=Q(x)R(y), where Q and R are given functions. When R(y)<>0 we can divide by R(y) and rewrite this in the form A(y)y'=Q(x) where A(y)=1/R(y). Thus A(y)dy = Q(x)dx can be implicitly integrated to hopefully solve the equation. Note that this method is presented here to solve "first-order" ordinary differential equations. A more complex treatment is probably needed to solve higher order equations. Just for example try to imagine how to solve a "2nd-order" separable ordinary differential equation of the form y"=f(x,y) after the separation this equation looks like A(y)y" = Q(x). Which "hopefully" can be solved using double integrals.

      SPECIAL CASE #1: Homogeneous first-order equations that are not separable can be converted to separable first-order equations with variable substitution. Let me explain how it works. A special kind of first-order equations of the form y'=f(x,y) in which the right-hand side has the property that f(tx,ty)=f(x,y) for all x, y, and all t<>0 are called homogeneous. In other words, replacement of x by tx and y by ty has no effect on the value of f(x,y). If we substitute t by t=1/x, the initial equation becomes y'=f(1,y/x). The appareance of the quotient y/x on the right suggests that we introduce a new unknown function v where v=y/x. Then y=vx, and so y'=xv'+v and this substitution transforms y'=f(1,y/x) into xv'+v = f(1,v) or x(dv/dx) = f(1,v)-v. This last equation is a first-order separable equation for v and so solvable by the separate method too.
      Example: y'=(y-x)/(y+x)
      Solution: We rewrite the equation as y'=(y/x-1)/(y/x+1) then we substitute v=y/x to transform this into x(dv/dx) = [(v-1)/(v+1)]-v = -(1+v^2)/(v+1), or (v+1)/(1+v^2)dv = -(1/x)dx. now we can integrate both sides of the equation to obtain a solution on terms of v and x. Lastly, we replace v by y/x to obtain the solution in terms of x and y.

      SPECIAL CASE #2: A first-order differential equation of the form y'=f(ax+by+c) where b<>0, can always be reduced to a separable first-order equation by means of the substitution v=ax+by+c.
      Example: y'=1/(x+y+1)
      Solution: If we let v=x+y+1, then dv/dx=1+dy/dx, so the differential equation is transformed into (dv/dx)-1=1/v or dv/dx=(1+v)/v, so [v/(1+v)]dv = dx which is integrable in both sides. Finally, we replace v by x+y+1 to obtain the solution in terms of x and y.
      (20 votes)
  • blobby green style avatar for user Tindall
    What if you had a differential equation where you couldn't immediately separate them by division? What happens if you have an equation like dy/dx = y-10? Do you multiply by a conjugate?? Please help....
    (3 votes)
    Default Khan Academy avatar avatar for user
  • purple pi teal style avatar for user Gustav Eriksen
    Why is the integral of cos(x) not -sin(x) at ?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • female robot grace style avatar for user Jamie Morgan
      The fundamental theorem of calculus says that f(x) is a differentiable function, then the integral of f'(x) is just f(x). Now if f(x) = sin(x), then f'(x) = cos(x). This means that the integral of cos(x) is just sin(x).

      (Note: I wish I could use integral signs but I can't find a good way to do so).
      (8 votes)
  • blobby green style avatar for user Christophe De Troyer
    I enjoyed this video but I'm running into a problem solving a seperable differential equation.

    It's this one:
    dy/dx = 2x + 1. The problem i run into is that you can't get a proper seperation for dy and y's on the left side, and dx and x's on the right side. How do I go about solving this?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Nina_23_55
    what is the derivative of tan^3(x)?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • leaf grey style avatar for user Qeeko
      Use the chain rule. Let u = tan x, then du/dx = sec² x.
      d/dx [tan³ x] = d/dx [u³] = (du/dx) · d/du [u³] = sec² x · 3u² = 3tan² x · sec² x

      In general, d/dx [tanⁿ x] = n · tanⁿ⁻¹ x · sec² x
      (4 votes)
  • blobby green style avatar for user amanda Goddard
    how does one go about integrating both sides in an equation like this:
    xdy-ydx=0
    integral(x/dx)=integral(y/dy)
    where the dx and dy's are in the denominator?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Adu  Samuel
    What is the solution of the differential equation dy/dx+y/x=yx
    (1 vote)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user famousguy786
      Subtract y/x from both sides and you get-
      dy/dx= yx- y/x
      Take y common on the right hand side and then the equation is-
      dy/dx= y( x- 1/x )
      So now we have a variable separable differential equation. Try solving it from this step onward and see what solution you derive.
      I got the answer as
      ln(y)= x²/2 - ln(x) + C
      (2 votes)
  • blobby green style avatar for user priyankapramanik10
    how to solve dy/dx=sin square y
    (1 vote)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user RandomDad
      As following:
      Step 1 : separate dy with independent y variable and the same method with dx.
      1/ sin²(y) dy = dx
      Step 2: integrate the both sides
      ∫ 1/ sin²(y) dy = ∫ dx
      you could write it as ∫ csc²y dy = ∫ dx
      Step 3: the home stretch
      -cot(y) = x+C or - cos(y)/sin(y) = x or y = arccot(-x+C)
      C= -cot(y)-x input your initial condition there.
      If you want to know how intgrating csc²(y) is equal to -cot(y), try to derive y=cot(x)
      cot is 1/tan where tan = sin/cos, thus, cot= cos/sin.
      (2 votes)
  • mr pants teal style avatar for user Alejandro Lorenzo
    Can anyone give an example of taking an equation and through implicit differentiation get a differential equation? I just can't visualize what master Khan is talking about when he says that a separable differential equation was implicitly derived.
    (1 vote)
    Default Khan Academy avatar avatar for user
    • spunky sam blue style avatar for user Ethan Dlugie
      Here is a super simple example.
      x+y=5 -> d(x)/dx + d(y)/dx=d(5)/dx
      1+dy/dx=0 You may be inclined to think dy/dx=0, but it's not because y is a function of x
      dy/dx=-1. There you go. Differential equation!
      How about a more complex example.
      x^2-y^2=sinx
      2x-2y*dy/dx=cosx remember, we do chain rule on d/dx (y^2)
      dy/dx=(cosx-2x)/-2y=(2x-cosx)/2y. Another differential equation. This one looks more complicated, but it is still straightforward to solve as a separable diffyq.
      (3 votes)

Video transcript

I think it's reasonable to do one more separable differential equations problem, so let's do it. The derivative of y with respect to x is equal to y cosine of x divided by 1 plus 2y squared, and they give us an initial condition that y of 0 is equal to 1. Or when x is equal to 0, y is equal to 1. And I know we did a couple already, but another way to think about separable differential equations is really, all you're doing is implicit differentiation in reverse. Or another way to think about it is whenever you took an implicit derivative, the end product was a separable differential equation. And so, this hopefully forms a little bit of a connection. Anyway, let's just do this. We have to separate the y's from the x's. Let's multiply both sides times 1 plus 2y squared. We get 1 plus 2y squared times dy dx is equal to y cosine of x. We still haven't fully separated the y's and the x's. Let's divide both sides of this by y, and then let's see. We get 1 over y plus 2y squared divided by y, that's just 2y, times dy dx is equal to cosine of x. I can just multiply both sides by dx. 1 over y plus 2y times dy is equal to cosine of x dx. And now we can integrate both sides. So what's the integral of 1 over y with respect to y? I know your gut reaction is the natural log of y, which is correct, but there's actually a slightly broader function than that, whose derivative is actually 1 over y, and that's the natural log of the absolute value of y. And this is just a slightly broader function, because it's domain includes positive and negative numbers, it just excludes 0. While natural log of y only includes numbers larger than 0. So natural log of absolute value of y is nice, and it's actually true that at all points other than 0, its derivative is 1 over y. It's just a slightly broader function. So that's the antiderivative of 1 over y, and we proved that, or at least we proved that the derivative of natural log of y is 1 over y. Plus, what's the antiderivative of 2y with respect to y? Well, it's y squared, is equal to-- I'll do the plus c on this side. Whose derivative is cosine of x? Well, it's sine of x. And then we could add the plus c. We could add that plus c there. And what was our initial condition? y of 0 is equal to 1. So when x is equal to 0, y is equal to 1. So ln of the absolute value of 1 plus 1 squared is equal to sine of 0 plus c. The natural log of one, e to the what power is 1? Well, 0, plus 1 is-- sine of 0 is 0 --is equal to C. So we get c is equal to 1. So the solution to this differential equation up here is, I don't even have to rewrite it, we figured out c is equal to 1, so we can just scratch this out, and we could put a 1. The natural log of the absolute value of y plus y squared is equal to sine of x plus 1. And actually, if you were to graph this, you would see that y never actually dips below or even hits the x-axis. So you can actually get rid of that absolute value function there. But anyway, that's just a little technicality. But this is the implicit form of the solution to this differential equation. That makes sense, because the separable differential equations are really just implicit derivatives backwards. And in general, one thing that's kind of fun about differential equations, but kind of not as satisfying about differential equations, is it really is just a whole hodgepodge of tools to solve different types of equations. There isn't just one tool or one theory that will solve all differential equations. There are few that will solve a certain class of differential equations, but there's not just one consistent way to solve all of them. And even today, there are unsolved differential equations, where the only way that we know how to get solutions is using a computer numerically. And one day I'll do videos on that. And actually, you'll find that in most applications, that's what you end up doing anyway, because most differential equations you encounter in science or with any kind of science, whether it's economics, or physics, or engineering, that they often are unsolveable, because they might have a second or third derivative involved, and they're going to multiply. I mean, they're just going to be really complicated, very hard to solve analytically. And actually, you are going to solve them numerically, which is often much easier. But anyway, hopefully at this point you have a pretty good sense of separable equations. They're just implicit differentiation backwards, and it's really nothing new. Our next thing we'll learn is exact differential equations, and then we'll go off into more and more methods. And then hopefully, by the end of this playlist, you'll have a nice toolkit of all the different ways to solve at least the solvable differential equations. See you in the next video.