Euler’s theorem and harmonic functions

Some multivariable functions carry a hidden bookkeeping rule: scale every input by the same factor tt, and the output scales predictably too. These are the homogeneous functions, and Euler's theorem turns that scaling rule into a compact identity linking a function to its own partial derivatives — useful both as a fast way to evaluate awkward combinations like xfx+yfyxf_x+yf_y and as a built-in check on your partial-derivative algebra. A second, unrelated identity governs harmonic functions: those whose second partials satisfy Laplace's equation fxx+fyy=0f_{xx}+f_{yy}=0. Harmonic functions describe steady-state temperature and electrostatic potential in physics, and — as you will see later, in Complex Variables — they are exactly the real and imaginary parts of an analytic function. This article builds both identities and shows, with one running example, that they are genuinely independent properties.

The core insight

A homogeneous function of degree nn obeys xfx+yfy=nfxf_x+yf_y=nf (Euler's theorem), while a harmonic function separately satisfies Laplace's equation fxx+fyy=0f_{xx}+f_{yy}=0, and a function can have either property, both, or neither.

The core idea

Homogeneity is a scaling rule. A function f(x,y)f(x,y) is homogeneous of degree nn if replacing x→tx, y→tyx\to tx,\ y\to ty pulls out an overall factor tnt^n:

f(tx,ty)=tnf(x,y)for all t>0.f(tx,ty) = t^n f(x,y) \quad \text{for all } t>0.

where: nn is the degree of homogeneity, found by direct substitution rather than guessed from the highest total-degree term — this matters for quotients and roots, where the answer is not always obvious from inspection. For example f(x,y)=x3+3x2y−y3f(x,y)=x^3+3x^2y-y^3 is degree 33 (every monomial has total degree 33), while f(x,y)=x2+y2f(x,y)=\sqrt{x^2+y^2} is degree 11, since f(tx,ty)=tx2+y2f(tx,ty)=t\sqrt{x^2+y^2}. A quotient like f(x,y)=y2/xf(x,y)=y^2/x is also degree 11: substituting gives f(tx,ty)=(ty)2/(tx)=t (y2/x)f(tx,ty)=(ty)^2/(tx)=t\,(y^2/x), so the tt's from numerator and denominator do not simply cancel to t0t^0 — you must carry the algebra through rather than eyeball the exponents. It helps to notice why the definition is stated for polynomials in the first place: a sum of monomials is homogeneous of degree nn exactly when every monomial individually has total degree nn, because substituting x→tx, y→tyx\to tx,\ y\to ty multiplies a monomial xpyqx^py^q by tp+qt^{p+q}, and a sum of terms all carrying the same power of tt factors that common power straight out. Mixed-degree sums such as x2+yx^2+y fail the test for precisely this reason — no single tnt^n can be factored out of t2x2+tyt^2x^2+ty.

Euler's theorem converts scaling into a derivative identity. For a differentiable homogeneous function of degree nn,

xfx+yfy=nf,xf_x + yf_y = nf,

and differentiating this relation once more (applying it to fxf_x, itself homogeneous of degree n−1n-1, and to fyf_y) gives the second-order extension

x2fxx+2xyfxy+y2fyy=n(n−1)f.x^2f_{xx} + 2xyf_{xy} + y^2f_{yy} = n(n-1)f.

where: fx,fyf_x,f_y are the first partials and fxx,fxy,fyyf_{xx},f_{xy},f_{yy} the second partials, with fxy=fyxf_{xy}=f_{yx} guaranteed equal by Clairaut's theorem, which is exactly why the mixed term above carries a coefficient of 22. Both identities let you check a partial-derivative computation independently, or shortcut a problem that only asks for the combination xfx+yfyxf_x+yf_y: instead of computing fxf_x and fyf_y separately and then forming xfx+yfyxf_x+yf_y by hand, you can read off the degree nn by inspection and immediately write down nfnf, saving a line of algebra on exam problems built around this identity.

Harmonicity is an unrelated second-order condition. A function f(x,y)f(x,y) with continuous second partials is harmonic if it satisfies Laplace's equation:

fxx+fyy=0.f_{xx}+f_{yy}=0.

Verifying this is a direct two-step computation — find fxxf_{xx}, find fyyf_{yy}, check the sum vanishes. Harmonic functions model steady-state temperature fields, electrostatic potentials, and incompressible irrotational flow; here they are treated purely as real-variable objects, though their deeper identity as the real and imaginary parts of an analytic complex function f(z)=u+ivf(z)=u+iv is the subject of the Cauchy-Riemann equations later in the course. Unlike homogeneity, harmonicity has no simple substitution test — there is no shortcut analogous to plugging in tx,tytx,ty. Every check genuinely requires computing both second-order partial derivatives from scratch and adding them, which is why it is worth being fast and careful with second partials before attempting this kind of problem under time pressure.

Figure
Two independent tests on the same function panel one scales the inputs by t to check homogeneity panel two sums the two second partials to check harmonicity
Two independent tests on f(x,y) Test 1 — homogeneity (x, y) (tx, ty) f(tx,ty) = t^n f(x,y) ? Test 2 — harmonicity f_xx + f_yy = 0 ? The two tests use different derivatives and can pass or fail independently of each other
Derivation AProving Euler's first-order theorem from the scaling definition

The goal is to derive the identity xfx+yfy=nfxf_x+yf_y=nf starting only from the defining relation f(tx,ty)=tnf(x,y)f(tx,ty)=t^nf(x,y), using nothing beyond the chain rule for a function of one variable tt — showing that Euler's theorem is not a separate assumption but a direct consequence of what homogeneity of degree nn already means.

Step 1. Start from the definition, valid for every t>0t>0 with x,yx,y held fixed: f(tx,ty)=tnf(x,y)f(tx,ty)=t^nf(x,y). Treat both sides as functions of the single variable tt and differentiate with respect to tt.

Step 2. Differentiate the left side using the chain rule. Writing u=tx, v=tyu=tx,\ v=ty, we get ddtf(u,v)=fu⋅dudt+fv⋅dvdt=fx(tx,ty)⋅x+fy(tx,ty)⋅y\dfrac{d}{dt}f(u,v) = f_u\cdot\dfrac{du}{dt} + f_v\cdot\dfrac{dv}{dt} = f_x(tx,ty)\cdot x + f_y(tx,ty)\cdot y, since du/dt=xdu/dt=x and dv/dt=ydv/dt=y.

Step 3. Differentiate the right side directly: ddt[tnf(x,y)]=ntn−1f(x,y)\dfrac{d}{dt}\left[t^nf(x,y)\right] = nt^{n-1}f(x,y), since f(x,y)f(x,y) does not depend on tt. Equating the two sides gives xfx(tx,ty)+yfy(tx,ty)=ntn−1f(x,y)xf_x(tx,ty)+yf_y(tx,ty) = nt^{n-1}f(x,y) for every t>0t>0.

Step 4. Set t=1t=1. The relation becomes xfx(x,y)+yfy(x,y)=n⋅1n−1f(x,y)=nf(x,y)xf_x(x,y)+yf_y(x,y) = n\cdot1^{n-1}f(x,y) = nf(x,y), which is Euler's theorem. Because x,yx,y were arbitrary fixed values throughout, this holds at every point where ff is differentiable — the identity is not a one-off coincidence but a structural consequence of homogeneity.

Step 5. The second-order relation follows the same pattern one level up. Since fxf_x is itself homogeneous of degree n−1n-1 (differentiating f(tx,ty)=tnf(x,y)f(tx,ty)=t^nf(x,y) with respect to xx shows fx(tx,ty)⋅t=tnfx(x,y)f_x(tx,ty)\cdot t = t^n f_x(x,y), i.e. fx(tx,ty)=tn−1fx(x,y)f_x(tx,ty)=t^{n-1}f_x(x,y)), applying Euler's first-order theorem to fxf_x gives xfxx+yfxy=(n−1)fxxf_{xx}+yf_{xy}=(n-1)f_x; applying it to fyf_y gives xfxy+yfyy=(n−1)fyxf_{xy}+yf_{yy}=(n-1)f_y. Multiplying the first by xx, the second by yy, and adding reproduces x2fxx+2xyfxy+y2fyy=(n−1)(xfx+yfy)=(n−1)(nf)=n(n−1)fx^2f_{xx}+2xyf_{xy}+y^2f_{yy}=(n-1)(xf_x+yf_y)=(n-1)(nf)=n(n-1)f, using the first-order result once more in the final step.

Worked example

Verify both the first- and second-order Euler relations for f(x,y)=x3+2x2y−xy2+y3f(x,y)=x^3+2x^2y-xy^2+y^3, and check whether the same function is harmonic.

Step 1. Confirm the degree. Every term has total degree 33 (x3x^3, 2x2y2x^2y, xy2xy^2, y3y^3), and directly f(tx,ty)=t3f(x,y)f(tx,ty)=t^3f(x,y), so n=3n=3.

Step 2. Compute the first partials: fx=3x2+4xy−y2f_x=3x^2+4xy-y^2 and fy=2x2−2xy+3y2f_y=2x^2-2xy+3y^2. Forming xfx+yfyxf_x+yf_y gives 3x3+4x2y−xy2+2x2y−2xy2+3y3=3x3+6x2y−3xy2+3y33x^3+4x^2y-xy^2+2x^2y-2xy^2+3y^3 = 3x^3+6x^2y-3xy^2+3y^3, which equals 3f=3(x3+2x2y−xy2+y3)3f=3(x^3+2x^2y-xy^2+y^3) exactly — the first-order Euler relation holds.

Step 3. Compute the second partials: fxx=6x+4yf_{xx}=6x+4y, fxy=4x−2yf_{xy}=4x-2y, fyy=−2x+6yf_{yy}=-2x+6y. Forming x2fxx+2xyfxy+y2fyyx^2f_{xx}+2xyf_{xy}+y^2f_{yy}: x2(6x+4y)+2xy(4x−2y)+y2(−2x+6y)=6x3+4x2y+8x2y−4xy2−2xy2+6y3=6x3+12x2y−6xy2+6y3x^2(6x+4y)+2xy(4x-2y)+y^2(-2x+6y) = 6x^3+4x^2y+8x^2y-4xy^2-2xy^2+6y^3 = 6x^3+12x^2y-6xy^2+6y^3. Compare with n(n−1)f=6f=6x3+12x2y−6xy2+6y3n(n-1)f=6f=6x^3+12x^2y-6xy^2+6y^3 — the two match, confirming the second-order relation.

Step 4. Check harmonicity separately: fxx+fyy=(6x+4y)+(−2x+6y)=4x+10yf_{xx}+f_{yy}=(6x+4y)+(-2x+6y)=4x+10y, which is not identically zero. This ff is homogeneous of degree 33 and satisfies both Euler relations, but it is not harmonic — confirming the two properties are independent even for the same function.

Competitive stretch

Test u(x,y)=excos⁡yu(x,y)=e^x\cos y: uxx=excos⁡yu_{xx}=e^x\cos y and uyy=−excos⁡yu_{yy}=-e^x\cos y, so uxx+uyy=0u_{xx}+u_{yy}=0 and uu is harmonic everywhere. But u(tx,ty)=etxcos⁡(ty)u(tx,ty)=e^{tx}\cos(ty) cannot be written as tnu(x,y)t^nu(x,y) for any fixed nn, since tt sits inside the exponential and cosine rather than as an overall scale factor — so uu is harmonic but not homogeneous of any degree, the mirror case to Step 4 above. For a function that is genuinely both, try g(x,y)=x2−y2g(x,y)=x^2-y^2: it is homogeneous of degree 22 (every term has total degree 22, and g(tx,ty)=t2x2−t2y2=t2g(x,y)g(tx,ty)=t^2x^2-t^2y^2=t^2g(x,y)), and gxx=2, gyy=−2g_{xx}=2,\ g_{yy}=-2 gives gxx+gyy=0g_{xx}+g_{yy}=0, so gg is also harmonic. Together, ff, uu and gg populate all three non-trivial cells of the two-by-two grid — homogeneous only, harmonic only, and both — leaving only "neither" to find on your own, for example h(x,y)=x2+yh(x,y)=x^2+y.

Common traps

  • Confusing homogeneity with harmonicity. They are independent tests on different derivatives — a function can pass one, both, or neither, as the worked example and its stretch both show.
  • Guessing the degree nn instead of substituting. For quotients or roots such as f=y2/xf=y^2/x or f=x2+y2f=\sqrt{x^2+y^2}, always compute f(tx,ty)f(tx,ty) directly rather than reading nn off the highest total-degree term.
  • Dropping the factor of 22 in the second-order relation. The identity x2fxx+2xyfxy+y2fyy=n(n−1)fx^2f_{xx}+2xyf_{xy}+y^2f_{yy}=n(n-1)f needs the coefficient 22 on the mixed term, since fxyf_{xy} and fyxf_{yx} both contribute and are equal by Clairaut's theorem.
  • Declaring harmonicity from only one second partial. Both fxxf_{xx} and fyyf_{yy} must be computed, and it is specifically their sum that must vanish.

Ask the tutor: if you want to practice finding the degree of an unusual homogeneous function or verifying harmonicity step by step, ask the AI tutor to work through a fresh example with you.

If a function is homogeneous, does that automatically make it harmonic too?

No. Homogeneity is about how ff scales under x→tx, y→tyx\to tx,\ y\to ty, while harmonicity is about whether fxx+fyy=0f_{xx}+f_{yy}=0 — two completely different computations on different derivatives. The worked example's function x3+2x2y−xy2+y3x^3+2x^2y-xy^2+y^3 is homogeneous of degree 33 but has fxx+fyy=4x+10y≠0f_{xx}+f_{yy}=4x+10y\neq0, so it is not harmonic. You must check each property separately; passing one tells you nothing about the other.

Why does the second-order Euler relation have a 2 in front of the mixed term but the first-order one does not?

The first-order relation xfx+yfy=nfxf_x+yf_y=nf only involves two distinct first partials, fxf_x and fyf_y, each appearing once. The second-order relation comes from differentiating that identity again, and the cross term arises twice — once from differentiating fxf_x with respect to yy and once from differentiating fyf_y with respect to xx. Since fxy=fyxf_{xy}=f_{yx} by Clairaut's theorem, these two equal contributions combine into the single coefficient 2xyfxy2xyf_{xy}.

Where do harmonic functions come from in this course, and why do they matter later?

Right now they are introduced purely as real-variable functions satisfying fxx+fyy=0f_{xx}+f_{yy}=0, useful because they model steady-state temperature and electrostatic potential in physics and engineering. Later, in the Complex Variables unit, you will meet the Cauchy-Riemann equations and discover that if f(z)=u(x,y)+iv(x,y)f(z)=u(x,y)+iv(x,y) is analytic (complex-differentiable), then both uu and vv are automatically harmonic. That connection is not needed to verify harmonicity now — it is simply the reason this topic reappears.

Before this

Where this leads