Ma · Mathematics

How to Square a Taylor Series

Published By the 9to5Science editorial team

At a glance

  1. 1. Write the series

    Express the function as powers of x minus the expansion point.

  2. 2. Use the Cauchy product

    Multiply coefficients whose indices add to the desired power.

  3. 3. Collect each coefficient

    The coefficient of the nth power is a finite convolution sum.

  4. 4. Check the result

    Compare with known identities or differentiate the squared function directly.

A phrase such as “Taylor expansion square” usually means finding the Taylor expansion of [f(x)]2[f(x)]^2 when the Taylor expansion of f(x)f(x) is known. The correct operation is not to square each coefficient separately. Instead, multiply the series and collect powers of x−ax-a.

If the question literally concerns the Taylor expansion of x2x^2, then about 00 the answer is simply x2x^2: it is already a polynomial, so all Taylor coefficients above degree two are zero. About a general center aa, the same polynomial written in powers of x−ax-a is

x2=a2+2a(x−a)+(x−a)2.x^2=a^2+2a(x-a)+(x-a)^2.

The general rule

Suppose ff has a Taylor series about x=ax=a:

f(x)=∑n=0∞an(x−a)n.f(x)=\sum_{n=0}^{\infty} a_n(x-a)^n.

Squaring gives

f(x)2=(∑n=0∞an(x−a)n)(∑n=0∞an(x−a)n).f(x)^2=\left(\sum_{n=0}^{\infty}a_n(x-a)^n\right)\left(\sum_{n=0}^{\infty}a_n(x-a)^n\right).

The coefficient of (x−a)n(x-a)^n comes from every pair of terms whose powers add to nn. Therefore,

f(x)2=∑n=0∞cn(x−a)n,f(x)^2=\sum_{n=0}^{\infty}c_n(x-a)^n,

where

cn=∑k=0nakan−k.c_n=\sum_{k=0}^{n}a_k a_{n-k}.

This coefficient formula is called the Cauchy product of the two power series. For the square, it is a convolution of the coefficient sequence with itself.

Writing out the first terms makes the pattern clear:

f(x)2=a02+2a0a1(x−a)+(2a0a2+a12)(x−a)2+(2a0a3+2a1a2)(x−a)3+⋯ .\begin{aligned} f(x)^2={}&a_0^2+2a_0a_1(x-a)\\ &+(2a_0a_2+a_1^2)(x-a)^2\\ &+(2a_0a_3+2a_1a_2)(x-a)^3+\cdots. \end{aligned}

Worked example: squaring the exponential series

Find the Taylor series about 00 for (ex)2(e^x)^2 by squaring the Taylor series of exe^x.

The exponential series is

ex=1+x+x22!+x33!+x44!+⋯ .e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots.

The coefficients are an=1/n!a_n=1/n!. Using the Cauchy product, the first terms of the square are

(ex)2=1+2x+(2⋅12+1)x2+(2⋅16+2⋅12)x3+(2⋅124+2⋅16+14)x4+⋯=1+2x+2x2+43x3+23x4+⋯ .\begin{aligned} (e^x)^2 ={}&1+2x\\ &+\left(2\cdot\frac{1}{2}+1\right)x^2\\ &+\left(2\cdot\frac{1}{6}+2\cdot\frac{1}{2}\right)x^3\\ &+\left(2\cdot\frac{1}{24}+2\cdot\frac{1}{6}+\frac{1}{4}\right)x^4+\cdots\\ ={}&1+2x+2x^2+\frac{4}{3}x^3+\frac{2}{3}x^4+\cdots. \end{aligned}

Since (ex)2=e2x(e^x)^2=e^{2x}, its Taylor series is also

e2x=∑n=0∞(2x)nn!=1+2x+4x22!+8x33!+16x44!+⋯ .e^{2x}=\sum_{n=0}^{\infty}\frac{(2x)^n}{n!} =1+2x+\frac{4x^2}{2!}+\frac{8x^3}{3!}+\frac{16x^4}{4!}+\cdots.

This gives

e2x=1+2x+2x2+43x3+23x4+⋯ ,e^{2x}=1+2x+2x^2+\frac{4}{3}x^3+\frac{2}{3}x^4+\cdots,

which confirms the multiplication.

In fact, the coefficient identity behind this example is

∑k=0n1k!(n−k)!=2nn!.\sum_{k=0}^{n}\frac{1}{k!(n-k)!}=\frac{2^n}{n!}.

Worked example: squaring a sine series

The Maclaurin series for sine is

sin⁡x=x−x33!+x55!−x77!+⋯ .\sin x=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\cdots.

To calculate (sin⁡x)2(\sin x)^2 through degree six, retain enough terms and multiply:

(sin⁡x)2=(x−x36+x5120+⋯ )2=x2−x43+(136+160)x6+⋯=x2−x43+2x645+⋯ .\begin{aligned} (\sin x)^2 &=\left(x-\frac{x^3}{6}+\frac{x^5}{120}+\cdots\right)^2\\ &=x^2-\frac{x^4}{3}+\left(\frac{1}{36}+\frac{1}{60}\right)x^6+\cdots\\ &=x^2-\frac{x^4}{3}+\frac{2x^6}{45}+\cdots. \end{aligned}

The same result follows from the identity

sin⁡2x=1−cos⁡(2x)2.\sin^2x=\frac{1-\cos(2x)}{2}.

Using the cosine series produces

sin2x=x2−x43+2x645−⋯ .sin^2x=x^2-\frac{x^4}{3}+\frac{2x^6}{45}-\cdots.

Notice that only even powers appear. This is expected because sin⁡2x\sin^2x is an even function.

An alternative method: differentiate the square

You can also calculate the Taylor coefficients directly from the function g(x)=f(x)2g(x)=f(x)^2. The Taylor expansion about aa is

g(x)=∑n=0∞g(n)(a)n!(x−a)n.g(x)=\sum_{n=0}^{\infty}\frac{g^{(n)}(a)}{n!}(x-a)^n.

For the first few derivatives,

g(x)=f(x)2,g′(x)=2f(x)f′(x),g′′(x)=2(f′(x)2+f(x)f′′(x)).\begin{aligned} g(x)&=f(x)^2,\\ g'(x)&=2f(x)f'(x),\\ g''(x)&=2\bigl(f'(x)^2+f(x)f''(x)\bigr). \end{aligned}

Higher derivatives can be found with the product rule, although this becomes cumbersome. The Cauchy product is usually faster when the Taylor series of ff is already known. Direct differentiation is useful when ff is simple but its series is not yet available.

Expansion about a nonzero point

The method does not depend on expanding about zero. For example, suppose

f(x)=2+3(x−1)+4(x−1)2+⋯ .f(x)=2+3(x-1)+4(x-1)^2+\cdots.

Then

f(x)2=4+12(x−1)+(16+9)(x−1)2+⋯=4+12(x−1)+25(x−1)2+⋯ .\begin{aligned} f(x)^2={}&4+12(x-1)\\ &+\bigl(16+9\bigr)(x-1)^2+\cdots\\ ={}&4+12(x-1)+25(x-1)^2+\cdots. \end{aligned}

The coefficient of (x−1)2(x-1)^2 is obtained from

2⋅2⋅4+32=25.2\cdot 2\cdot 4+3^2=25.

Common mistakes

Squaring each coefficient

In general,

(∑n=0∞anxn)2≠∑n=0∞an2xn.\left(\sum_{n=0}^{\infty}a_nx^n\right)^2\neq\sum_{n=0}^{\infty}a_n^2x^n.

For instance, the coefficient of xx in the square is 2a0a12a_0a_1, not a12a_1^2.

Forgetting cross terms

When multiplying truncated series, terms such as 2a0a22a_0a_2 and 2a1a2x32a_1a_2x^3 must be included. They are often the source of incorrect coefficients.

Truncating too early

To find the square through degree nn, you need all terms of ff through degree nn. A term of degree kk multiplied by one of degree n−kn-k contributes to the answer.

Ignoring convergence

For a power series with radius of convergence RR, the Cauchy product equality certainly holds for ∣x−a∣<R|x-a|<R, where the series converge absolutely. Behavior on ∣x−a∣=R|x-a|=R requires separate analysis. The resulting squared power series can sometimes have a larger radius of convergence if singularities disappear upon squaring, but an independent analytic continuation of f(x)2f(x)^2 beyond that disk is not, in general, the same as the original Taylor series converging there.

References

  1. Calculus, Volume II — Tom M. Apostol
  2. Mathematical Analysis — Walter Rudin

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.