Problem Solving with Dimensional Analysis

Dimensional analysis is the technique of analyzing relationships through their base quantities. I demonstrate the power of this approach by approximating a Gaussian integral without calculus.

A dimension is a physical quantity that can be measured, while a unit is a specific amount of a physical quantity. For example, time is a dimension, which can be measured in temporal units such as hours or seconds.

Dimensional analysis is the technique of analyzing and simplifying equations by expressing terms using their dimensions rather than their numerical values. Because equations should be dimensionally consistent, meaning that the dimensions on both sides of an equation are equivalent, dimensional analysis is useful for making inferences about functional forms or the dimensions of variables. Note that this is distinct from analyzing units, although that is also a useful problem-solving technique.

In my experience, dimensional analysis is particularly useful when coming at a problem where even the structure or basic terms in the problem are unknown. For example, I often find myself using dimensional analysis when reading unfamiliar code. It does not clarify everything, but it often provides an “initial hook” by allowing me to quickly understand variables’ dimensions or units.

The goal of this post is to demonstrate the power of dimensional analysis by working through the example that first convinced me while reading (Mahajan, 2010): simplifying a Gaussian integral.

Gaussian integral

Consider the integral

I=eax2dx.(1) I = \int_{-\infty}^{\infty} e^{-a x^2} dx. \tag{1}

Imagine that we didn’t know calculus. We just think of integrals as sums and dxdx as “a little bit of xx”. And imagine that we had never seen this equation before. Let’s use dimensional analysis to make sense of it.

Perhaps the simplest thing we can say is that both sides of the equation must have the same dimensions. It must be dimensionally valid. Let’s use the notation [x][x] to denote the dimensions of xx rather than its numerical value. We’ll use unity to denote a dimensionless quantity, i.e. [x]=1[x] = 1 means that xx is dimensionless. Using this notation, we can express dimensional validity as

[I]=[eax2dx].(2) \left[ I \right] = \left[ \int_{-\infty}^{\infty} e^{-a x^2} dx \right]. \tag{2}

But beyond this, what can we do? The problem is that this problem has no inherent dimensions! If this were a physics problem, perhaps terms would be concretized with units. But here, this is just an abstract mathematical object. However, we can still make progress by assigning an arbitrary dimension to one of the variables and then seeing what that implies. Let’s do this by assigning an arbitrary dimension to xx, say L\mathbb{L} (imagine this is “length”). What does this imply about the dimension of aa?

We can see that xx and aa are related via the exponent. Now note that exponents must be dimensionless quantities. That is because xx raised to nn is just xx multiplied by itself that many times:

xn=xxxxn times.(3) x^n = \overbrace{x \cdot x \cdot x \cdot \dots \cdot x}^{\text{$n$ times}}. \tag{3}

So nn is just a number here, not a dimensioned quantity. In general, the full term xnx^n may have units. If xx has dimensions feet, and n=2n=2, then x2x^2 has dimensions ft2\text{ft}^2 (or area). However, Euler’s number ee is actually dimensionless. It’s a mathematical constant, and much like π\pi, it doesn’t make sense to talk about the dimension of ee. Thus, we know that ax2-a x^2 must have no units, because it’s an exponent, and we know that eax2e^{-a x^2} must be dimensionless because it is merely Euler’s number raised to a dimensionless exponent.

For the exponent to be unitless, this implies that aa must have dimension 1/L21 / \mathbb{L}^2, since

[a][x2]=1L2L2=1.(4) \left[a\right]\left[x^2 \right]= \frac{1}{\mathbb{L}^2} \mathbb{L}^2 = 1. \tag{4}

Now that we have the dimensions of aa and xx, let’s analyze the integral. First, observe that the integral is loosely a summation, and it only makes sense to reason about adding two quantities together if they have the same dimensions, e.g. a length plus a length is another length. So we can think of summation and integration as operations that do not change their arguments’ dimensions. And dxdx is “a little bit of xx” and thus has the same units as xx. Here, it has dimension L\mathbb{L}.

So we can summarize our analysis so far as

[I]=[eax2dx]=[eax2]×[dx]=1×L=L.(5) \left[ I \right] = \left[ \int_{-\infty}^{\infty} e^{-ax^2} dx \right] = \left[ e^{-ax^2} \right] \times \left[ dx \right] = 1 \times \mathbb{L} = \mathbb{L}. \tag{5}

Now observe that II is a function of just aa. This is because xx is a dummy variable, equivalent to xix_i in a sum. So we could write

[f(a)]=[eax2dx]=L.(6) \left[ f(a) \right] = \left[ \int_{-\infty}^{\infty} e^{-a x^2} dx \right] = \mathbb{L}. \tag{6}

What does this imply about the functional form of ff? Since aa has dimensions L2\mathbb{L}^{-2}, then f(a)f(a) must have the functional form

f(a)1a.(7) f(a) \sim \sqrt{\frac{1}{a}}. \tag{7}

I’ll explain the notation \sim in the next section, but for now, just think of it as approximately equal. How did we get here? Because both sides of the equation above must be dimensionally consistent, we can see that

[1a]=1L2=L.(8) \left[\sqrt{ \frac{1}{a} }\right] = \sqrt{\frac{1}{\mathbb{L}^{-2}}} = \mathbb{L}. \tag{8}

So we used the dimensions of aa and f(a)f(a) to infer the functional form of f(a)f(a)!

Okay, so now for the impressive bit. How good did we do? If we use calculus, we can see that this integral is equal to

eax2dx=πa.(9) \int_{-\infty}^{\infty} e^{-a x^2} dx = \sqrt{\frac{\pi}{a}}. \tag{9}

In my mind, this is pretty cool! Using nothing more than reasoning about the dimensions of our problem and applying some fairly elementary mathematical knowledge, we were able to understand the basic structure of an integral!

Equality up to a dimensionless factor

The notation \sim means equality up to a factor without dimensions. Equation 77 is equality up to dimensionless factor because we could multiply 1/a\sqrt{1/a} by a dimensionless factor kk and still have Equation 88 hold since

[ka]=[k]L2=L.(10) \left[\sqrt{\frac{k}{a}}\right] = \sqrt{\frac{[k]}{\mathbb{L}^{-2}}} = \mathbb{L}. \tag{10}

You might wonder if we could be off by an additive factor, but this is handled by the multiplicative factor kk. Why? We cannot add a dimensioned quantity to a dimenionless quantity. (What is 33 feet plus the number 77?) So any additive factor must have dimension L\mathbb{L}, and is thus absorbed by the dimensionless factor kk.

Finally, a note about π\pi in Equation 99. From a purely mathematical point of view, π\pi is just as important as aa here. But in many real-world applications, where we want to just use mathematics to make sense of a system, aa is typically much more important. It is the dimensioned quantity whose value changes the value of the integral.

Different initial dimensions

One question you might be asking yourself is: did we just get lucky when we picked [x]=L[x] = \mathbb{L}? Wonderfully, no. We could have started anywhere else, and we would have had the same result, because all dimensional analysis is doing is ensuring that equations and their terms are dimensionally consistent.

For example, imagine that we had started with the assumption that the dimension of aa was M2/3\mathbb{M}^{2/3}. Then the same reasoning about exponents implies that

[x]=M1/3.(11) [x] = \mathbb{M}^{-1/3}. \tag{11}

The integral then has dimensions M1/3\mathbb{M}^{-1/3}, and thus so does f(a)f(a):

[f(a)]=M1/3.(12) \left[f(a)\right] = \mathbb{M}^{-1/3}. \tag{12}

So the only dimensionally valid functional form for f(a)f(a) is

f(a)1a,(13) f(a) \sim \frac{1}{\sqrt{a}}, \tag{13}

which is what we inferred previously.

In my mind, this really highlights the power of dimension analysis. If we don’t understand a problem at all, we can still start by assigning arbitrary dimensions and then using those dimensions to make basic inferences about the shape of our problem. And of course, when we do have more context, dimensional analysis is even easier.

A harder problem

Let’s conclude by exploring a similar problem but one in which dimensional analysis fails. Consider the Gaussian integral in Equation 11 but with a=1a=1:

I=ex2dx.(14) I = \int_{-\infty}^{\infty} e^{-x^2} dx. \tag{14}

Here, we must immediately infer that x2-x^2 is dimensionless, since it is an exponent, and thus xx is dimensionless. In other words, while this problem looks quite similar to our earlier problem, we are immediately stuck. Perhaps we could have a moment of insight and actually introduce a dimensioned quantity aa, but that would not help us much, since we could only use dimensional analysis to infer that

f(a)1a=1.(15) f(a) \sim \sqrt{\frac{1}{a}} = 1. \tag{15}

In fact, the real value of the integral is π\sqrt{\pi}. We would still only be wrong up to a dimensionless factor, but this is not as satisfying as our earlier result. The point here is that dimensional analysis, like any tool, has particular uses and limitations. Despite this, I think it is still a useful tool to have in one’s problem-solving toolbelt.

  1. Mahajan, S. (2010). Street-fighting mathematics: the art of educated guessing and opportunistic problem solving. The MIT Press.