Differential Equations Primer

The questions below are due on Monday March 10, 2025; 10:00:00 PM.
 
You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.

1) Prelude

Next week, we're going to start working with circuits that involve capacitors and inductors. Like we've done with the other components we've seen so far, in our lumped-element model, we'll gloss over some of the details of these components and model them with a constitutive equation. In other words, we'll model the way they constrain the respective voltages that develop across them and the respective currents that flow through them.

With these components, we're taking an interesting and exciting leap, because these components differ from the other components we've seen so far in at least one key way: they store energy, and they are stateful. For example, when, determining the voltage across a capacitor, it isn't enough to know the current flowing through the capacitor at that moment in time; rather, we need to know something about the history of values. As such, there is something different about these components' constitutive equations, compared against the components we've seen before:

For one, note that we've labeled each component's current and voltage as a function of time, since we're going to need to care about how those signals change with time (though we'll often omit the (t) to keep things from getting cluttered). Even more importantly, both of these equations involve derivatives (or there are equivalent forms we could write that involve integrals).

The key thing here is that when we use the methods we've developed over the course so far (KVL/KCL, node method, superposition, etc) in circuits involving inductors or capacitors, we end up getting a system of differential equations instead of a system of linear equations when solving out for the currents and voltages in our circuit.

When it comes down to it, we'll only have a couple of kinds of differential equations that we're going to have to solve in 6.200. We don't have differential equations as a prerequisite, and our intention is to teach you what you need to know in order to be able to solve the few different kinds of differential equations we'll see in 6.200. This exercise is a first step in that direction, an introduction to the methods we'll need to use over the course of the next week. We won't bother with a lot of proofs or things like that (this will be a little hand-wavy; we'll just try to get to the answer in a way that hopefully makes sense), but you should feel free to ask for more detail if you want to, and it's also probably a good idea to take 18.03 in the future if you haven't already done so.

Regardless, please don't skip over the derivations below, and please ask for help if you get stuck. We'll review some of these things in lecture next week, but it's good to get a handle on them before lecture, to the extent that you can.

2) Limiting Our Focus

For the next several weeks, we're only going to be dealing with a category of differential equations: first-order linear differential equations with constant coefficients. Specifically, we are going to be solving for x in an equation like the following:

\dot{x} + kx = f(t)

where \dot{x} represents the derivative of x with respect to time (we'll often also use x' or {{\rm d}\over {\rm d} t} x or {{\rm d} x\over {\rm d} t} to represent this).

This equation is first-order because it has only a single time derivative (no second derivatives). It's linear because the terms on the left are a linear combination of x and its derivatives, and we also note that the coefficients associated with each of those terms is constant with respect to time.

In general, we will also not be able to solve for x(t) without knowing some initial condition on its value. That is to say, we need to know both this differential equation and the value of x(t) at some point in the past.

3) Solving When f(t) = 0

Let's start thinking about a relatively-simple case, where the right-hand side of this equation is equal to 0. In that case, we have an equation like:

\dot{x} + kx = 0

Here, we can jump straight to what's actually going to be a pretty important step for us: we'll take an educated guess at an assumed form for our answer.

In order for that sum to work out to zero, we need \dot{x} to look a lot like its time derivative, differing only by a scaling factor (in math jargon, we need x to be an eigenfunction of the differentiation operator). As such, a reasonable guess is that x(t) is of the form Ae^{st} for some values of A and s; since the derivative of {{\rm d}\over {\rm d}t}Ae^{st} = sAe^{st}, we can pick values of A and s such that sAe^{st} and kAe^{st} cancel each other out.

So now we can try to solve for A and s. A place to start is by plugging this assumed form x(t) = Ae^{st} into our equation from above:

\dot{x} + kx = 0~~~~~\Rightarrow~~~~~{{\rm d}\over {\rm d}t}Ae^{st} + kAe^{st} = 0~~~~~\Rightarrow~~~~~sAe^{st} + kAe^{st} = 0

From that point, a little bit of algebra gets us to the point of seeing that s = -k, so our answer now must have the form x(t) = Ae^{-kt} for some value of A. But note that this didn't help us figure out A at all!

This is where the initial condition comes in. In order to find the full solution, we need to know the value of x(t) at some point. So if we imagine that we know x(t_0) = x_0, then we can solve for x(t > t_0) by solving our equation at that known time:

x(t_0) = x_0~~~~~\Rightarrow~~~~~Ae^{-kt_0} = x_0~~~~~\Rightarrow~~~~~A = {x_0\over e^{-kt_0}}

With that, we have our final solution! To satisfy the equation \dot{x} + kx = 0 under the condition that x(t_0) = x_0, we must have:

x(t > t_0) = Ae^{st} = {x_0\over e^{-kt_0}}e^{-k(t)} = x_0e^{-k(t-t_0)}

This answer traces out an exponential curve, like so:

This solution (when f(t) = 0) goes by a number of different names, depending on context. It's called the general solution or the homogeneous solution or the steady-state solution.

Remember This!

It's always good to know how to rederive something if you get stuck, but this is going to be a very common result for us, so it's also OK just to commit this solution to memory (both the algebraic form and the graphical form), so long as you're careful about when to apply it.

3.1) An Example

Now let's take a look at a slightly-more-concrete example. Let's solve 3\dot{x} + x = 0, subject to the constraint that x(7) = 5.

Again, we can assume that x(t) has the form x(t) = Ae^{st} for some values of A and s. If we plug that assumed form into the equation above, we find:

3sAe^{st} + Ae^{st} = 0

This equation alone doesn't give us enough information to solve for A, but it does let us solve for s. From this equation, what is the value of s? Enter your answer either as an exact number or as a simple fraction.
 
s =~

By incorporating information from the initial condition, we can also solve for A. After rearranging, we can arrive at a form like x(t) = Be^{s(t-7)}. In this form, what is the value of B?
 
B =~

4) Solving When f(t) = c

Now let's take another leap and solve a similar differential equation, but where we're setting \dot{x} + kx equal not to 0, but to some other constant value c. That is to say, let's try to solve:

\dot{x} + kx = c

subject to the constraint that x(t_0) = x_0.

We could imagine taking a similar approach to what we did above, starting by assuming a form of x based on the equation. But here, the natural form to assume would be that x(t) = c/k, since that makes our differential equation trivially true; if x(t) = c, we have \dot{x} + kx + c = 0 + k(c/k) = c.

We call this solution the particular solution or the specific solution or the steady-state solution.

4.1) A Problem

But, unfortunately, there's an issue with this proposed solution which means that (at least on its own), it isn't actually a solution to the problem we were setting out to solve... sad emoji

Check Yourself!

What is wrong with the proposed solution of x(t) = c/k?

The unfortunate thing about this proposed solution is that, while it satisfies the equation we've specified above, it can't be made to satisfy the specified initial condition (unless x_0 = c, which we generally can't assume).

So how do we get around this? Well, we need another solution, and one that frees us up to choose parameters so as to satisfy our initial conditions, while not breaking the fact that we're satisfying the equation \dot{x} + kx = c.

4.2) A Solution

We're going to construct this solution by taking the homogeneous solution from above (i.e., the solution to \dot{x} + kx = 0) and add it to the particular solution we just found (i.e., the solution that satisfies \dot{x} + kx = c). The resulting sum will be a new solution to \dot{x} + kx + c but with a degree of freedom that will let us match our initial condition.

Why does this work? Well, let's look by example. Imagine we have a solution x_h(t) that satisfies the homogeneous equation from above, i.e., \dot{x}_h + kx_h = 0. And let's also assume a solution x_p(t) that satisfies the specific equation, i.e., \dot{x}_p + kx_p = c.

Now consider a new function x(t) = x_h(t) + x_p(t). If we plug this back into our original equation, we have:

\begin{aligned} \dot{x} + kx &= {{\rm d}\over{\rm d}t}(x_h + x_p) + k(x_h + x_p)\\ &=\dot{x}_h + \dot{x}_p + kx_h + kx_p\\ &=(\dot{x}_h + kx_h) + (\dot{x}_p + kx_p)\\ &= 0 + c = c \end{aligned}

So the sum of the homogeneous and particular solutions gives us an actual solution to the problem. And the reason to go to this trouble is that this will let us satisfy not only the differential equation, but the initial condition we were given as well.

4.3) Applying This Idea

Now that we've tried to justify the approach, let's apply it. Recall that we were trying to find a solution to \dot{x} + kx = c subject to the initial condition that x(t_0) = x_0.

We can do this by first finding the homogeneous part of the solution (i.e., a solution to \dot{x} + kx = 0) which we already found above: x_h(t) = Ae^{-kt} for some value of A that depends on initial conditions.

Then we find the particular part of the solution, i.e., any solution that satisfies \dot{x} + kx = c regardless of initial conditions, which we already found to be x_p(t) = c/k.

We can add these two together to get a complete solution to the differential equation:

x(t) = x_h(t) + x_p(t) = Ae^{-kt} + c/k

for some value of A that depends on initial conditions. So this is when we plug some values in. Since we know that x(t_0) = x_0, we can find:

x(t_0) = x_0 = Ae^{-kt_0} + c/k

\Rightarrow A = {x_0 - c/k \over e^{-kt_0}}

Plugging it all together, we have our solution:

x(t) = x_h(t) + x_p(t) = {x_0 - c/k\over e^{-kt_0}}e^{-kt} + c/k

We can rearrange this solution into a number of different forms, all of which are equivalent but each of which may be more- or less-useful depending on the context:

x(t) = {x_0 - c/k\over e^{-kt_0}}e^{-kt} + c/k

x(t) = \left(x_0 - c/k\right)e^{-k(t-t_0)} + c/k

x(t) = x_0e^{-k(t-t_0)} + \left(c/k\right)\left(1 - e^{-k(t - t_0)}\right)

x(t) = x_0 + \left(c/k - x_0\right)\left(1 -e^{-k(t-t_0)}\right)

All of these forms are equivalent, and they all describe a similar kind of exponential shape to the one we saw above, but this time starting at some value x_0 and converging (as t\to \infty) to some other value c/k:

Remember This!

Again, it's always great to understand where results come from and to be able to rederive them when necessary, but this is another case where it's not a bad idea to commit this result to memory, since this is another kind of differential equation we're going to see over and over again for the remainder of 6.200.

4.4) An Example

Let's once again try to put ourselves to the test here. Find a solution to the following differential equation:

{1\over 5} \dot{x} + x = 4

subject to the constraint that x(3) = 8.

Remember our general process:

  • Find the homogeneous part of the solution, except for any values that can only be determined by initial conditions.
  • Find the particular part of the solution.
  • Add those two together.
  • Use the initial condition to solve for any remaining unknown values.

Solve the differential equation above and enter your answer below. Your answer can depend on a variable t. Use Python notation to enter your expression, and use either e**a or exp(a) to represent e^a.
 
x(t) =~

5) Parting Thoughts

In this problem, we've tried to introduce you to some of the math we're going to be using over the next few weeks, introducing a couple of forms of differential equations we're going to see quite often over the course of the semester, and working through solving those equations.

For now, these ideas are somewhat abstract. Next week, we'll talk about applying these ideas to circuits involving capacitors and inductors; but we wanted at least to expose you to some of the math we're going to be using before we get there. It's our hope that seeing these concepts again next week in the context of real circuits will help to solidify them, and also that having seen these ideas in the abstract before working with them will help make next week's material more approachable as well.

Then in future weeks, we'll consider variations on these themes, including second-order differential equations and solving in situations where the right-hand side of these equations is not constant.