Simply supported beam—Castigliano's method

Continuing our series on the many ways to get the center deflection of a uniformly loaded beam, we come to another energy-based technique: Castigliano’s method.

Castigliano’s second theorem provides a relationship between displacements, forces, and the strain energy in a linearly elastic system. The strain energy, U, is the potential energy of the system due to its deformation. For a generic elastic body, like this,

Elastic potato

Castigliano’s second theorem can be as:

If an elastic system is mounted so that rigid-body displacements of the entire system are impossible and certain external point forces P1, P2, … act on the system, in addition to distributed loads and thermal strains, the displacement component δi of the point of application of force Pi in the direction of force Pi is determined by the equation

δi=UPi

I took this from Henry Langhaar’s Energy Methods in Applied Mechanics, a favorite text of mine. I’ve altered the variable names to avoid conflicting with some variable names we’ve used in previous posts in this series.

Looking this over and thinking about it in terms of our problem,

Simply supported beam with uniform load

two concerns come to mind:

  1. Our problem doesn’t have a point force at the center of the beam, where we want to determine the deflection.
  2. Even if we did have a point force at the center of the beam, how do we write an expression for the strain energy in terms of that force?

Let’s tackle the second concern first. Recall from our two Rayleigh-Ritz posts (Fourier and polynomial) that the potential energy associated with beam bending is

0L12EI(y)2dx

This is the strain energy, U. Unfortunately, it’s written in terms of deflection, not force, but we can fix that. We saw early on that the curvature, y, and the bending moment, M, are proportional:

M=EIyory=MEI

We substitute the second of these into the expression for U to get

U=0LM22EIdx

Because the bending moment can be written in terms of the applied loads, we’ve solved the second concern.

We solve the first concern with a trick. We can pretend there’s a load, P, at the center of the beam, and write out an expression for the bending moment, M, that includes P.

Simply supported beam with uniform and concentrated load

We then do the integration to get U, take its derivative with respect to P, and—here’s the trick—evaluate the derivative for P=0. This may seem like cheating, but it’s perfectly legitimate. Imagine P is very very small—it won’t contribute much to the deflection. So why not just make it zero?

Let’s go ahead and see what happens. The upward support reaction force at end of the beam above is (wL+P)/2, so we can draw a free-body diagram for the left portion of the beam like this:

Free-body diagram for Castigliano

where x<L/2. The bending moment in the left half of the beam is therefore

M=12[(wL+P)xwx2]

and its square is

M2=14[(wL+P)2x22w(wL+P)x3+w2x4]

This formula applies only in the left half of the beam, but because of symmetry we know that

U=0LM22EIdx=20L/2M22EIdx=0L/2M2EIdx

So

U=14EI0L/2[(wL+P)2x22w(wL+P)x3+w2x4]dx=14EI[13(wL+P)2x312w(wL+P)x4+15w2x5]0L/2=14EI[L324(wL+P)2L432w(wL+P)+L5160w2]

Taking the derivative with respect to P gives us

UP=14EI[L312(wL+P)L432w]

Therefore the downward deflection at the center of the beam is

δ=UP|P=0=wL448EIwL4128EI=5wL4384EI

as we’ve now seen many times.

Since this is based on Castigliano’s second theorem, you may be wondering what kinds of problems we use his first theorem to solve. It’s a good question, but one I can’t answer. In the 45 years since I first learned of Castigliano’s theorems, I’ve never used his first one.


Simply supported beam—energy minimization with a polynomial

Today we’ll use the Rayleigh-Ritz method again, but this time we’ll avoid dealing with an infinite sum. In case you’ve forgotten, this is our problem:

Simply supported beam with uniform load

We’ll express the shape as a polynomial. The form of the governing differential equation,

EIyiv=w

tells us that our solution won’t have any terms of higher power than x4. That gets rid of the infinity problem, but a generic fourth-order polynomial still has five parameters,

y=a0+a1x+a2x2+a3x3+a4x4

which is more than we want to deal with. Let’s cut down further on the number of parameters by taking advantage of some other things we know. First, the solution will have to be symmetric, so we can express it with symmetric terms right from the start. Second, we know the solution will have to meet these boundary conditions:

y(0)=y(L)=y(0)=y(L)=0

Here’s the form we’ll start with:

y=ax(Lx)+bx2(Lx)2

This is a fourth-order polynomial. We know it’s symmetric about the center of the beam because switching the x and Lx terms (which is like flipping the beam around) yields the same equation. And it’s clear that y(0)=y(L)=0, so we meet two of the four boundary conditions. Now we’ll take on the other two boundary conditions.

We’ll use the product rule and a little algebraic rearranging to give us the first derivative with respect to x:

y=a(L2x)+2b[x(Lx)2x2(Lx)]

The second derivative is

y=2a+2b[(Lx)24x(Lx)+x2]

Since y(0)=0,

2a+2bL2=0

which means

b=aL2

and therefore, after some more algebraic cancellation and rearranging,

y=a[x(Lx)+1L2x2(Lx)2]

and

y=12aL2x(Lx)

Because we started with a symmetric function, its second derivative is also symmetric and y(L)=0.

Now it’s time for Rayleigh-Ritz. Recall that the potential energy, Π, is

Π=0L12EI(y)2dx0Lwydx

Plugging in our expressions for y and y gives us

Π=72EIa2L40Lx2(Lx)2dxwa0Lx(Lx)dxwaL20Lx2(Lx)2dx

where the first term is the potential energy of the bent beam and the second two terms are the potential energy of the load as it moves down with the beam.

The integrals are fairly easy to work out. Just expand the polynomials and integrate term-by-term. Here are the results:

0Lx2(Lx)2dx=L530

and

0Lx(Lx)dx=L36

Therefore,

Π=72EIa2L4(L530)wa(L36)waL2(L530)=12EIL5a2wL35a

We minimize this by taking the derivative with respect to a, setting it to zero, and solving for a. That gives us

a=wL224EI

which we’ve seen as an intermediate solution before.

Finally, after plugging in this expression for a, we get

y(L2)=wL224EI(L2L2+1L2L24L24)=wL424EI(14+116)=5wL4384EI

Our old friend comes to visit again.


Let me take you down

I just learned that people are listening to music pitched slightly down because it makes them feel better. Instead of the A above middle C being set at 440 Hz, they have it tuned down to 432 Hz.

This strikes me as odd, but how you feel is how you feel. Do whatever you want, as long as it doesn’t hurt anyone. I was interested, though, in the math behind this pitch change.

In the equal-tempered scale, the frequency ratio of a semitone, which I’ll call rs is the twelfth root of two:

rs=212=21121.059463

This is the ratio of frequencies of adjacent piano keys.

The ratio of 440 Hz to 432 Hz is

440432=55541.0185185

so the pitch difference you get from moving down to 432 Hz is distinctly less than a semitone. How can we characterize that difference?

Small differences in pitch are measured in cents. There are 100 cents in a semitone, so the frequency ratio of one cent, rc, is

rc=rs100=2112001.00057779

To get the number of cents we move down in going from 440 Hz to 432 Hz, we solve this equation for n:

(211200)n=2n1200=5554

Taking the base-2 logarithm of both sides yields

n1200=log2(5554)

and therefore

n=1200log2(5554)31.767

So going from A440 tuning to A432 tuning means going down about 32 cents or about a third of a semitone. Not a lot, but you (probably) can hear it.

Here’s two seconds of A440:

And here’s two seconds of A432:

It’s easier to hear the difference when they’re played simultaneously because the beat frequency is distinct:


Given the name of this blog, I would be remiss if I didn’t mention the famous splice in “Strawberry Fields Forever.” There were two takes that John Lennon liked: a slower version in a lower key and a faster version in a higher key. He wanted the final song to have part of one and part of the other. Right. As luck would have it, though, producer George Martin and engineer Geoff Emerick learned that adjusting the tape speeds to bring the two tempos together also put them in the same key.


Simply supported beam—energy minimization with Fourier series

Continuing our trip through various methods to derive the equation for the center deflection of a uniformly loaded simply supported beam, today we’re going to do the first of two solutions using the Rayleigh-Ritz method.

Of all the possible shapes a beam can deform into, the shape it will deform into is the one that minimizes the potential energy of the system, the system being the beam and the load. The equation for the potential energy for our beam, Π, is

Π=0L12EI(y)2dx0Lwydx

where the first term comes from the bending of the beam (note its similarity to the formula 12kx2 for a spring) and the second term comes from the load acting through the deflection. The first term is positive because the potential energy of the beam increases as the beam bends; the second term is negative because the potential energy of the uniform load decreases as the load moves down with the beam.

Minimizing an expression like this with respect to the displacement function, y, is what the calculus of variations was invented to do. But Lord Rayleigh and Walther Ritz came up with a way to avoid the calculus of variations. Instead of considering all possible shapes for y, we can consider only certain shapes governed by a set of associated parameters. We then express the potential energy in terms of these parameters and solve for the parameter values that minimize it.

Let’s demonstrate with a simple example. We’ll assume y is of this form,

y=asinπxL

and find the value of a that minimizes Π

This sine function is a good choice because it meets all the boundary conditions of the simply supported beam: both it and its second derivative are zero at the two ends of the beam, i.e.,

y(0)=0,y(L)=0,y(0)=0,y(L)=0

(Recall that the moment is proportional to the second derivative of the displacement—since the moment is zero at a simply supported end, so is the second derivative.)

Given our choice for y, we can say that

y=a(πL)2sinπxL

Therefore,

Π=π4EI2L4a20Lsin2πxLdxwa0LsinπxLdx

The first integral works out to be L/2 and the second to 2L/π. So

Π=π4EI4L3a22wLπa

To find the value of a that minimizes this, we take its first derivative with respect to a and set it equal to zero:

dΠda=π4EI2L3a2wLπ=0

which means

a=4wL4π5EI

and

y(L2)=4wL4π5EIsinπ2=4wL4π5EI0.01307wL4EI

Compare this with our previous solution,

y(L2)=5wL4384EI0.01302wL4EI

and we see that the one-term Rayleigh-Ritz approximation is awfully close to the exact solution.

But our goal wasn’t to get awfully close; it was to get the exact solution. To do that, we need to take not a single sine term, but the sum of an infinite number of sine terms, like this:

y=m=1amsinmπxL

This is called a Fourier series, and you may recall seeing somewhere that a Fourier series can be fit to any function. In general, a Fourier series will have both sine and cosine terms, but for our problem the cosine terms drop out to meet the boundary conditions.

It may seem that we’ve just assigned ourselves an infinite amount of work, given that our expression for potential energy is now

Π=π4EI2L4m=1n=1n4aman0LsinmπxLsinnπxLdxwm=1am0LsinmπxLdx

But there are some features of the sine function that we can take advantage of. First and foremost, that nasty integral in the first term is actually quite simple:

0LsinmπxLsinnπxLdx={L2form=n0formn

And the second term can be simplified, too:

0LsinmπxLdx={ 2Lmπ for odd m 0 for even m

So we end up with

Π=π4EI4L3m=1m4am22wLπm=1,3,5,amm

We minimize with respect to the am by setting

Πam=0

for all m. Solving for am we get

am={ 4wL4m5π5 for odd m 0 for even m

Update 28 May 2026 2:39 PM
I forgot to mention here that when I first scratched out this solution in my notebook, I knew that the am would be zero for even m because of symmetry and never included them in the expression for y. Here, I decided to include the even values and show that they drop out as a natural consequence of the minimization process.

Plugging these results into our series expression for y and evaluating it at x=L/2 gives us

y(L2)=4wL4π5EIm=1,3,5,1m5sinmπ2

The sine term inside the sum alternates between 1 and –1, so we could write this as

y(L2)=4wL4π5EIm=1,3,5,(1)m12m5

At this point, I could get the sum from Mathematica with this expression,

Sum[(-1)^((m - 1)/2)/m^5, {m, 1, Infinity, 2}]

but that would be breaking my self-imposed rule against using computers in the derivation. Luckily, I have a book, An Introduction to the Elastic Stability of Structures by George Simitses, that discusses using infinite series in Rayleigh-Ritz solutions, and it includes this table of closed form solutions for infinite sums:

Simitses Table A-2

We can use the last entry in this table with x=π/2 to get

m=1,3,5,1m5sinmπ2=(π496)(π2)(π248)(π2)2+(π96)(π2)4=5π51536

And through the magic of cancellation,

y(L2)=(4wL4π5EI)(5π51536)=5wL4384EI

I’m not suggesting this is the best way to derive this formula, but it’s nice to know you can do it. And when you don’t need an exact answer, the Rayleigh-Ritz method can give you a good approximation without much work.