# Lagrangian method for an $LC$-Circuit

In the paper http://physics.unipune.ernet.in/~phyed/26.2/File5.pdf, the author solves the LC-circuit using Euler-Lagrange equation. She assumes that the Lagrangian function for the circuit is

$$L=T-V$$

where $T=L\dot q^2 / 2$ is the kinetic energy part and $V=q^2 / 2C$ is the potential energy. She then goes on to say that

$$\frac{d}{dt} \left ( \frac{\partial L}{\partial \dot q} \right ) - \frac{\partial L}{\partial q} = 0$$ is the equation of motion. I have a couple of questions:

1. Is Hamilton's principle applicable here? If yes, why is the kinetic energy part $\dfrac{{L\dot q^2}}{2}$?

2. Inductors also store potential energy temporarily in the magnetic field. Why don't we consider that term?

In this answer, I'm going to use $Q$ instead of $q$ for the capacitor charge.

There is only one certain rule for finding Lagrangians: The Lagrangian is chosen such as to get the correct equations of motion.

Never forget that. In the case of a circuit problem, the most sure way to know you got the right Lagrangian is to see if it gives you the right equations of motion, i.e. the equations you get from Kirchhoff's laws.

## Hamilton's principle

Is Hamilton's principle applicable here?

Let's start out by writing down Kirchhoff's laws for the LC circuit. Choose the orientation of current so that it's flowing into the inductor as shown. Then Kirchhoff's current rule and the definition of an inductor says $$I = -\dot{Q} \qquad \dot{I} = V/L$$ where $Q$ is the charge on the capacitor and $V$ is the voltage on the capacitor and inductor. The rule for a capacitor is $CV = Q$, so we can rewrite the second equation as $$\dot{I} = Q / LC \, .$$ Differentiating the first equation gives $$\dot{I} = - \ddot{Q}$$ which plugs into the line above to get $$\ddot{Q} = - Q/LC \, .$$ Defining $\omega_0^2 = 1/LC$ we now have the usual equation for a harmonic oscillator $$\ddot{Q} = -\omega_0^2 Q \, .$$ That's the equation of motion for the charge in an LC oscillator. Now let's see if the Lagrangian proposed by the author gives the same equation if we use the Euler Lagrange equations (a.k.a. Hamilton's principle). The Lagrangian is $$\mathcal{L} = \frac{L \dot{Q}^2}{2} - \frac{Q^2}{2C}$$ so the Euler Lagrange equations are \begin{align} \frac{d}{dt} \left(\frac{\partial \mathcal{L}}{\partial \dot{Q}} \right) - \frac{\partial \mathcal{L}}{\partial Q} =& 0 \\ \frac{d}{dt} \left(L \dot{Q} \right) + \frac{Q}{C} =& 0 \\ L \ddot{Q} + \frac{Q}{C} =& = 0 \\ \ddot{Q} = - \frac{Q}{LC} = - \omega_0^2 Q \, . \end{align} The result from Hamilton's principle matches the result from Kirchhoff's laws, so yes, Hamilton's principle is applicable here.

## Kinetic and potential energy

If yes, why is the kinetic energy part $L \dot{Q}^2 / 2$?

In the strictest sense, the kinetic energy part of the Lagrangian is $L \dot{Q}^2 / 2$ because it works to give the right equations of motion and that's the only thing that really matters in Lagrangian mechanics. However, another way to look at the Lagrangian of the LC oscillator is to simply note that each term is the energy of the capacitor and inductor respectively. The energy of a capacitor with charge $Q$ and capacitance $C$ is $Q^2 / 2C$. The author chose to call that the potential energy. The energy of an inductor with current $I$ and inductance $L$ is $LI^2/2$. Using $I = \dot{Q}$ we get that the energy of the inductor is $L\dot{Q}^2/2$, which is what the author used for the kinetic energy.

Therefore, you can reason that the author simply identified the two types of energy in the circuit, called one "kinetic" and the other "potential" and guessed the Lagrangian that way.

## More general Lagrangians in the context of circuits

A lot of us first learn about Lagrangians in the context of a physical particle moving around in a potential field. In that particular case, the Lagrangian is always $\mathcal{L} = T-V$, but that's far from the most general form of a Lagrangian. What happens, for example, if we have two systems connected to each other, such as two particles connected by a spring or two LC circuits connected through a capacitor?

It turns out there is actually a recipe for finding more complex Lagrangians without just guessing. That recipe is described for example in this article by Michel Devoret. The article is a rewrite of a famous set of course notes from the Les Houches summer school(pdf) done to correct a number of errors and clarify some points. Do not be discouraged by the word "quantum" in the title. Much of the discussion is purely classical physics.

Inductors also store potential energy temporarily in the magnetic field. Why don't we consider that term?

As just explained, we do, and it's what the author called the "kinetic" energy.

• @DanielSank: But what's the point of Lagrangian if we have to verify every time with Kirchhoff's laws? Aug 15, 2017 at 2:01
• @Razor one main point is that, especially if you know how to write the Lagrangian for a coupling between two oscillators, then you can easily write down the Lagrangian for a system of coupled oscillators simply by summing up the individual parts. This is much easier than trying to work out all of the Kirchhoff rules for a multi-loop circuit. Aug 15, 2017 at 2:05