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: exponential solution to differential equation

The solution of the general differential equation dy/dx=ky (for some k) is C⋅eᵏˣ (for some C). See how this is derived and used for finding a particular solution to a differential equation.

Want to join the conversation?

  • duskpin tree style avatar for user G Y
    Instead of putting the equation in exponential form, I differentiated each side of the equation:

    (1/y) dy = 3 dx
    ln y = 3x + C


    C = ln y - 3x

    So, plugging in the given values of x = 1 and y = 2, I get that C = ln(2) - 3. If you put this in a calculator, it's a very different value (about -2.307) than what Sal got by raising both sides to the power of e: 2 * e^-3 evaluates to about .0996.

    Why did my method not work?
    (15 votes)
    Default Khan Academy avatar avatar for user
    • ohnoes default style avatar for user Tejas
      It's important to note that the C you work with is not the same as the C Sal works with. At , Sal gets e^C, which he says is just going to be another arbitrary constant. Thus Sal replaces e^c with C. If you perform e^(-2.307) you should get 0.0996.
      (26 votes)
  • leaf green style avatar for user Sidharth Gat
    Sal changed e^C (which any arbitrary constant) to C (which is any another constant) and at least according to my knowledge C can't be any another constant as it will always be positive coz e^C can never be negative. We actually limited the value of our arbitrary constant to positive numbers, then shouldn't we mention that C is any constant number greater than zero i.e(C>0) ?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • old spice man green style avatar for user Alexander Bessman
      "Any arbitrary constant" includes complex numbers. Recall that e^(x*j) = cos(x) + j*sin(x). C could be, for example, 5 + π*j, in which case e^C ≈ -7.4.

      However, even with complex exponents, e^C can never be zero! In this case that does not matter, because we have already limited ourselves to y ≠ 0 by using 1/y as part of the solution. But it is certainly something to keep in mind for other situations.
      (2 votes)
  • aqualine ultimate style avatar for user Insatiable
    At around , Sal decides to consider only the first scenario that he broke the absolute value function into, saying that "it will take the [other, negative part of it] into consideration". How did he know this would happen?
    (9 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user brian harris
    When dealing with separable equations why in some videos do you put y and the constant on one side and in others (like this one) you only move y over?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • leafers sapling style avatar for user Dirk Kuiper
    Wouldn't it be possible to solve for C right after you integrated both sides of the separated equation? ln |y| = 3x + C , when x = 1, y = 2.
    Plug in these values and you'd get ln (2) = 3 + C, so C = ln (2) - 3
    Then you'd get ln |y| = 3x +ln (2) - 3
    So that y = e^(3x+ln (2) -3), because e^ln(2) = 2 you'd get 2e^(3x-3), and this is correct, but the method is different from the one Sal uses, can someone explain to me, why this works, or if there are any steps that aren't correct, so that you'd have to use Sal's method?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • boggle blue style avatar for user Bryan
    Why do we ultimately get the same specific solution when we solve for C with
    y = Ce^(3x)
    and substitute C back in and when we use
    y = -Ce^(3x)
    and substitute C back in?

    I might be missing something fairly obvious, but since both functions satisfy our original differential equation and are the reflections of each other over the x-axis, there should be two functions that both pass through the point (1, 2) and satisfy dy/dx = 3y right?

    Edit: I think (??) I answered my own question, but I would appreciate it if someone could verify it. In this case, since our two functions have C as a coefficient, and not as something that you add on, the two functions lead to the same specific solution. If you wanted to have the reflection over the x-axis of the solution also pass through the point, you would need to add a constant to it; but then, it wouldn't satisfy our differential equation.
    (3 votes)
    Default Khan Academy avatar avatar for user
  • leaf yellow style avatar for user Jose Molina
    If for whatever reason I had chosen to multiply both sides of the original integral in orange by -1, I would get very different solutions. I have always had a hard time understanding this. can someone help?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Abhinay Singh
    when I use y=-ce^3x then also I got the same ans y=e^(3x-3) as Sal sir got using y=ce^3x
    that means no effect of absolute value here?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • ohnoes default style avatar for user Louis Ullman
    I solved the integral by using U-substitution (int(1/3y)dy=int(1)dx), but after evaluating, I got ln|3y|=3x+C instead of ln|y|=3x+C. What did I do wrong?

    Here are my steps:

    (1 vote)
    Default Khan Academy avatar avatar for user
    • cacteye blue style avatar for user Jerry Nilsson
      There's nothing wrong.

      ln|3𝑦| = 3𝑥 + 𝐶 ⇒ 𝑦 = (1∕3)𝑒^(3𝑥 + 𝐶) ⇒ 𝑑𝑦∕𝑑𝑥 = 𝑒^(3𝑥 + 𝐶) = 3𝑦, which is the equation we started with.

      ln|𝑦| = 3𝑥 + 𝐶 ⇒ 𝑦 = 𝑒^(3𝑥 + 𝐶) ⇒ 𝑑𝑦∕𝑑𝑥 = 3𝑒^(3𝑥 + 𝐶) = 3𝑦
      (3 votes)
  • aqualine ultimate style avatar for user Liang
    at , does it mean that y=+/- Ce^3x could lead to the same solution of this differential equation?

    by substituting y=2 and x=1 into y=-Ce^3x, you get C=-2e^-3. sustituting this C back into y=-Ce^3x, you'll get the same y=2e^(3x-3)
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

- [Teacher] So, we've got the differential equation, the derivative of y with respect to x is equal to three times y. And we want to find the particular solution that gives us y being equal to two when x is equal to one. So, I encourage you to pause this video and see if you can figure this out on your own. All right, now, let's work through it together. So, some of you might have immediately said, "Hey, this is the form of a differential equation "where the solution is going to be an exponential," and you just got right to it. But, I'm not going to go straight to that, I'm just gonna recognize that this is a separable differential equation and that I'm gonna solve it that way. So, when I say that it's separable, that means that we can separate the y's, dy's, on one side, and all the x's, dx's on the other side. And so, what I can do is if I divide both sides of this equation by y and multiply both sides by dx, I get one over y, dy, is equal to three-dx. Now, on the left and right hand sides, I have these clean things that I can now integrate. That's what people talk about when they say separable differential equation. Now, here on the left, if I wanted to write it in a fairly general form, I could write, well, the anti-derivative of one over y is gonna be the natural log of the absolute value of y. I'm taking the anti-derivative with respect to y, here. Now, I could add a constant, but I'm gonna add in a constant on the right-hand side, so there's no reason to add two arbitrary constants on both sides. I could just add one on one side. So, that is going to be equal to the anti-derivative here is going to be three-x and I'll add the promised constant, plus c, right over there. And now, let's think about it a little bit. Well, we can rewrite this in exponential form. We could say, we could write, that e to the three-x plus c is equal to the natural log of y. I could write the natural of y is equal to e to three-x plus c. Now, I could rewrite this is equal to e to three-x times e to the c. Now, e to the c is just gonna be some other arbitrary constant, which I could still denote by c. They're are going to be different values, but we're just trying to just get a sense of what the structure of this thing looks like. So, we could say this is going to be some constant times e to the three-x. So, another way of thinking about it. Saying the absolute value of y is equal to this. This isn't a function yet. We're trying to find this function solution to this differential equation. So, this would tell us either y is equal to c, e to the three-x, or y is equal to negative c, e to the three-x. Well, we've kept it in general terms. I haven't put any... We don't know c is. So, what we could do, instead, is just pick this one, and then we can solve for c assuming this one right over here. And so, we will see if we can meet these constraints using this and it'll essentially take the other one into consideration, whether we're going positive or negative. So, let's do that. So, when y is equal to two, I'm now going to solve for c to find the particular solution, x is equal to one, or when x is equal to one, y is equal to two. So, I could write it like that, and we get two is equal to c times e to the third power, three times one. And so, to solve for c, I could just divide both sides by e to the third, and so I could, or I could multiply both sides times e to the negative third, and I could get two e to the negative third power is equal to c. And so let's now substitute it back in and our particular solutions is gonna be y is equal to c. C is two-e to the negative third power times e to the three-x. Now, I'm taking the product of two things with the same base. I can add the exponents. So, I could say y is equal to two times e to the three-x and I'll add the exponents to three-x minus three, and there you go. This is one way that you could write the particular solution that meets these constraints for this separable differential equation.