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

LC natural response - derivation

Formal derivation of the LC natural response, where we discover the frequency of oscillation. Written by Willy McAllister.
We derive the natural response of the inductor-capacitor, LC, circuit.
Inductor in parallel with a capacitor
This is where sine waves are born.

Background

This article walks you step-by-step through the solution to a 2nd-order differential equation. I don't assume you have previous experience with this type of equation. Sal has videos on 2nd-order equations, too. 1st-order differential equations are solved step-by-step in the articles on RC and RL natural response. You can also check out Sal's videos on 1st-order differential equations.

What we're building to

The natural response of an LC circuit is described by this homogeneous second-order differential equation:
Ld2idt2+1Ci=0
The solution for the current is:
i(t)=CLV0sinωt
Where ω=1LC is the natural frequency of the LC circuit and V0 is the starting voltage on the capacitor.
In electrical engineering, we use the letter j as the 1.
(The letter i is already taken for current.)

Introduction

First-order systems

Natural response of an RC circuit, described by a 1st-order differential equation.
Up to now we've looked at first-order circuits, RC and RL, that have one energy-storage element, C or L. The natural response of first-order circuits has an exponential shape that "slumps" to its final value. The energy in its storage element is dissipated by the resistor.

Second-order systems

Now we look at a circuit with two energy-storage elements and no resistor. Circuits with two storage elements are second-order systems, because they produce equations with second derivatives.
This article covers the LC circuit, one of the last two circuits we will solve with full differential equation treatment. The last circuit to get this treatment is the RLC (in the next article). The mathematics of differential equations keeps getting harder. Fortunately, after we are done with the LC and RLC, we learn a really nice shortcut to make our lives simpler.
We stick with differential equations instead of going straight to the shortcut because I want to show you where sine waves come from in electronics. Sine waves emerge from the solution to second-order equations. Sine waves are important. They are the building block for all other types of signals.
Second-order systems are the first systems that rock back and forth in time, or oscillate. The classic example of a mechanical second-order system is a clock with a pendulum. In electronics, the classic second-order system is the LC circuit.

Natural response

We want to find the natural response of the LC circuit. The natural response is what a circuit does when there is no external driving force. Natural response is always an important part of the total response of a circuit.

Natural response of a 2nd-order circuit

To get going on a precise answer for the natural response, let's set up the circuit with some initial energy. The components are labeled with careful attention to the sign convention for passive components. The inductor has an initial current of 0A because the switch starts in the open position. We assume the capacitor has an initial voltage before the switch closes, vC=V0. ( Notice how vC has its + sign at the bottom.) We let the switch close at t=0.
As with every circuit analysis, we begin by writing one of Kirchhoff's Laws. In this case, we'll go with Kirchhoff's Voltage Law (KVL) around the loop, starting at the lower left and going around clockwise.
vL+vC=0
Ldidt+1Cidt=0
This KVL equation contains an integral, which is awkward to deal with. The way to get rid of an integral (also known as an anti-derivative) is to take its derivative. We take the derivative of every term in the equation.
ddt(Ldidt+1Cidt)=ddt0
This gives us the second derivative of the L term, gets rid of the integral in the 1/C term, and still leaves us with 0 on the right side.
Ld2idt2+1Ci=0
The equation is tidier if the first term has no coefficient, so we divide through by L. This second-order differential equation captures the essence of our circuit.
d2idt2+1LCi=0

Propose a solution

When we solved the first-order RC and RL circuits, we guessed at an exponential solution for i(t). Guessing works with second-order equations, too. Our second-order equation has similar requirements: we want the function and its derivatives to look like each other so they can all add up to 0. The exponential function fits the description. We propose an exponential function with some adjustable parameters:
i(t)=Kest
K is an amplitude factor that scales the current big or small.
s is up in the exponent sitting next to time t. Since exponents don't have dimensions, s has to have units of 1/t, which is also known as frequency. Since we are solving a natural response, s is called the natural frequency.
Now we substitute our proposed function into the differential equation and check to see if it makes the equation true.
d2idt2+1LCi=0
d2dt2(Kest)+1LC(Kest)=0
Let's work on the first term by taking two derivatives. The first derivative is:
ddt(Kest)=sKest
And now the second derivative:
d2dt2(Kest)=ddt(sKest)=s2Kest
We plug our new second derivative back into the equation:
s2Kest+1LCKest=0
And do some factoring to pull Kest to the side:
Kest(s2+1LC)=0
How many ways can we make this equation true?
K=0 is pretty boring. 0=0, who cares?
est never becomes zero for a finite amount of time.
That leaves the interesting solution when the (s+1/LC) term equals 0:
s2+1LC=0
This equation is called the characteristic equation of our circuit. We want to find the roots of the characteristic equation (the value(s) of s that make left side equal zero).
s2=1LC
Whoa, look what's about to happen. We're about to take the square root of a negative number. We are about to generate an imaginary number.
s has two possible values:
s1=+j1LC
s2=j1LC
Electrical engineers use the letter j to indicate the imaginary unit, 1, since we already use i for current.
As a shorthand, we give a name to the square root term:
ω=1LC
The roots of the characteristic equation can be expressed in terms of ωo as:
s1=+jω
s2=jω
How about that! The LC circuit produces two complex natural frequencies, s1 and s2. And one of the natural frequencies is negative. So curious. This will turn out to be very interesting.
Either s1 or s2 by itself is a root of the equation. For our proposed solution we allow the possibility of both natural frequencies, s1 and s2. So we write a general solution as a linear combination of two terms, with two adjustable K constants.
i(t)=K1e+jωt+K2ejωt
At this point you might be thinking, "Complex exponents? Negative frequency? Is this really happening?" The answer is, yes. So please hang in there while we work with these expressions.

Euler's identities

To work with these complex exponents, we resort to an important identity.
Using Maclaurin series expansions for ejx, sinjx, and cosjx, it is possible to derive these Euler identities:
e+jx=cosx+jsinx
ejx=cosxjsinx
In the linked video, anytime Sal says i, we will say j.
These identities let us turn the strange eimaginary thing to a normal complex number. The real and imaginary parts come from a cosine or sine function, so both the real and imaginary components are somewhere in the range 1 to +1.

Use Euler's identities

We can use Euler's identities in our proposed solution.
i(t)=K1e+jωt+K2ejωt
i(t)=K1(cosωt+jsinωt)+K2(cosωtjsinωt)
Multiply through the constants:
i(t)=K1cosωt+jK1sinωt+K2cosωtjK2sinωt,
and gather the cosine terms and sine terms together:
i(t)=(K1+K2)cosωt+j(K1K2)sinωt
We don't know K1 or K2, or their sum or difference. It seems perfectly ok to replace the unknown K's with different unknown A's, just to make things appear a bit simpler.
If we let A1=(K1+K2), and A2=j(K1K2), then i(t) is:
i(t)=A1cosωt+A2sinωt
We used Euler's identities to rearrange the complex exponentials into a sum of trig functions. This equation is the very first time in electronics we see a sine or cosine as a function of time (a sinusoidal waveform).
(Notice how we defined A2 to include j(K1K2), so j no longer directly appears in the proposed solution.)

Test the proposed solution

Next, we check our proposed solution by plugging it into the second-order differential equation. If we can come up with values for the constants that make the differential equation true, the proposed solution is a winner.

Figure out the initial conditions

The initial conditions needed for a second-order circuit are a little more involved than for a first-order circuit. When we did this for first-order circuits, RC or RL, we had to know a single value, a starting current or voltage. With a second-order LC circuit, we need to know two things: the current and the derivative of the current when the switch closes.
Circuit conditions just before the switch closes, at t=0.
We write down everything we know about t=0 (the moment just before the switch closes):
  • The switch is open, so i(0)=0
  • The starting capacitor voltage is specified: vC(0)=V0.
If t=0+ is the moment just after the switch closes, our goal is to find i(0+) and di/dt(0+).
We know some properties of inductors and capacitors that will take us from t=0 to t=0+:
  • Inductor current cannot change instantly, so
    i(0+)=i(0)=0
  • Capacitor voltage cannot change instantly, so
    v(0+)=v(0)=V0
(After the switch closes there is only one v, so we'll just call it v from now on.)
Circuit conditions just after the switch closes, at t=0+. There is now just one voltage, v=vL=vC. The initial voltage on the capacitor is v=+V0.
Now we have i(0+), but not di/dt(0+), yet. Where can we get this derivative? How about from the inductor's i-v equation?
v=Ldidt
didt(0+)=1Lv(0+)
didt(0+)=1LV0
Now we have our second initial condition. This says the moment just after the switch closes, the current in the inductor starts changing with a slope of V0/L amperes every second.

Summary of the initial conditions

i(0+)=0
didt(0+)=1LV0

Use the initial conditions to find A1 and A2

We use our initial conditions one at a time to solve for the constants. The first initial condition is i=0 at t=0+. Let's plug it into the proposed solution and see where it takes us:
i(t)=A1cosωt+A2sinωt
0=A1cos(ω0)+A2sin(ω0)
0=A1cos0+A2sin0
10=A1cos00+A2sin0
0=A1
A1 is 0, so the proposed cosine term drops out of the solution. Our proposed solution now looks like:
i(t)=A2sinωt
Now we go after A2 using the second initial condition. The derivative of i at t=0+ is:
didt(0+)=1LV0
Take the derivative of the proposed i(t):
didt=ddt(A2sinωt)
didt=ωA2cosωt
Evaluating this expression at t=0:
1LV0=ωA2cos(ω0)
1LV0=ωA21
A2=1ωLV0
We can expand ω into L and C to get:
A2=CLV0
And finally, after a lot of hard work, the solution for the current is:
i(t)=CLV0sinωt

Real component values

To demonstrate what the solution looks like, we assign component values L=1 henry and C=1/4 farad, and a starting voltage on the capacitor of 10V.
The natural frequency, ω is:
ω=1LC=111/4=2radians/second
The current as a function of time is:
i(t)=CLV0sinωt=1/4110sinωt
i(t)=5sin2t
The current starts up the moment the switch closes:
The current takes off in a sine wave pattern that continues forever. (There is no resistor in this ideal circuit, so the energy never dissipates. In a real-world circuit there would be small resistances that eventually dissipate the energy.)
The natural frequency of the sine wave is ω=2radians/sec. We can convert from radians per second to cycles per second, (also known as hertz, or Hz) knowing that 1 full cycle of a sine function corresponds to 2π radians. We usually use the symbol f for cycles per second. The conversion is:
ω=2πf
The natural frequency of the circuit in cycles per second, hertz, Hz, is:
f=2radians/sec2π=1πHz,
or equivalently, the current completes a full cycle every π seconds.

A quick look back at the initial conditions

We can look in close to the origin to see how the solution accounted for the initial conditions. The sine wave starts at the origin, i=0. And notice how the slope of the blue sine wave near the origin matches the slope of the straight black line, i=10A/sec.

Voltage, v(t)

At this point we have solved the current. If you want to press on a little further, have a go at solving for the voltage, v(t).
Find an expression for v(t) after the switch closes.
Probably the quickest route is to use the inductor i-v equation to solve for v in terms of di/dt.
v(t)=

Summary

We derived the natural response of an LC circuit by first creating this homogeneous second-order differential equation:
d2idt2+1LCi=0
Then we assumed a solution of the form Kest, which gave us the characteristic equation for the circuit:
s2+1LC=0
When computing the roots of the characteristic equation we ran head on into a very strange expression: ejωt, an exponential with complex exponent. We reached deep into our bag of tricks and pulled out:
Euler's identities
e+jx=cosx+jsinx
ejx=cosxjsinx
These identities let us express the complex exponential as a combination of sine and cosine functions. (In electrical engineering, we use the letter j as the name for 1.)
Then we looked carefully at the circuit to find the initial conditions. For a second-order system, we found an initial i and an initial di/dt.
We found a function for i(t) that satisfied the differential equation:
i(t)=CLV0sinωt
ω1LC is the natural frequency of the LC circuit.
V0 is the starting voltage on the capacitor.
(This solution applies when the starting current in the inductor is 0.)

Want to join the conversation?

  • aqualine ultimate style avatar for user Helga Vuska
    Under First Order Systems in the Introduction, would it be right to call the natural response of a first order an exponential decay in terms of the graph? Thank you!
    (2 votes)
    Default Khan Academy avatar avatar for user
  • mr pink red style avatar for user manavpandya31
    After solving quadratic, we concluded that two roots are S1 and S2. But why did we are both to get general solution ? Isn't answer supposed to be one of the roots ?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • spunky sam orange style avatar for user Willy McAllister
      You can't decide ahead of time what the answer is 'supposed' to be. You have to see what the math tells you. We proposed a very general solution, with terms that included S1 and S2. Then we proceeded to test the proposed solution by plugging it into the differential equation and testing to see if the equation came out true. Along the way we computed the leading constants. In the end we got a true solution, which makes us very happy and also makes us love the proposed solution.

      What would have happened to the math if our fancy 2-term proposed solution was too fancy? The derivation would cause one of the terms to drop out. This would happen for example if K2 turned out to be 0. That didn't happen, did it?
      (2 votes)
  • mr pink red style avatar for user manavpandya31
    Its stated that capacitor voltage can't change instantly, so v(0-) = v(0+) = Vo. But v(0-) is -Vo. Why were signs changed ?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Dmitry Khamitov
    Why can we write i(t) = K1 * e^jwt + K2 * e^-jwt? I would expect that we work out i(t) separately for each of s. Do I miss something?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Nikolay
    I think there is a typo in the last sentence.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Alexander Wu
    How did the imaginary j in A2 disappear after we solved for it? Does that mean (K1 - K2) is an imaginary number?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Jon H Hall
      The j is simply a component of A2. Since A2=j(K1-K2), and A2 is a real number, then (K1-K2) is also imaginary. We can try and solve for K1 and K2, but there is no need as K1 and K2 are not actually part of the solution that we need for i.
      (1 vote)
  • starky sapling style avatar for user Juniper
    If the capacitor starts with an initial charge, shouldn't the current be flowing out of the positive side of the capacitor? This seemed to be the case with the RC circuit, and is also labeled as such in the RLC circuit, why is this case labeled with a different convention?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • old spice man green style avatar for user Willy McAllister
      In this simple LC circuit it is oddly difficult to specify (label) the voltage and current. This strangeness first appears in the section "Natural response of a 2nd-order circuit" where it looks like the capacitor voltage is upside down for no good reason.

      There is a reason (I hope you think it is a good one). It helps me get write the KVL equation correctly with the correct signs. (Try this: Flip vc around so it is positive at the top, just like vl. See if you can write the KVL equation (it will be different), and then derive the exact same differential equation. This may turn out to be easy for you, or it may drive you nuts.)

      That, I hope, justifies the upside down vc. I hope you noticed that a little farther down in the derivation I switched from vl an vc to a simpler v(t). v(t) is positive at the top, just like vl.

      You are correct that an initial voltage on the capacitor means the initial surge of current when the switch closes will be upward out of the capacitor. If we write the current surge in terms of vc it would initially have a negative value. However, by the time we get to the solution I'm working with v(t), so the plot shows a positive surge at the start.

      Sorry this is so convoluted. It stems from the fundamental need to respect the sign convention for passive components.
      (1 vote)
  • leafers sapling style avatar for user claireannedawson
    Wouldn't it have been simpler to just use i=Ksin(st) as the initial guess for solving the 2nd order ODE? Since we know that the double derivative of a sine function ends up as a -sine function, you would always have some +sine + -sine = 0. Which fulfils the ODE.
    Then you wouldn't have to mess around with complex numbers and Euler's formulae to get to the same answer. I tried it out on paper from i=Ksin(st) when I first saw you going with exponentials and got to the same result much faster.
    Is there any reason to use exponentials other than trying to keep the same pattern as the derivations from the previous circuits?
    (1 vote)
    Default Khan Academy avatar avatar for user