Fourier Cosine Series — Question 4

PDF ↗

Question 4

For f=exf=e^x on [0,1][0,1], improve a cosine approximation by matching slopes: ℓ=x+e−12x2,r=ex−ℓ,AN=ℓ+mr+∑n=1Ncncos⁡(nπx),\ell=x+\frac{e-1}{2}x^2,\qquad r=e^x-\ell,\qquad A_N=\ell+m_r+\sum_{n=1}^Nc_n\cos(n\pi x), where mr=∫01rm_r=\int_0^1r and cn=2∫01r(x)cos⁡(nπx)dxc_n=2\int_0^1r(x)\cos(n\pi x)dx.

Tasks

  1. Compute the raw mean and cosine coefficients of exe^x. Find the endpoint slopes of every raw cosine partial sum.

  2. Verify the slopes of ℓ\ell, then compute mrm_r and all cnc_n. Explain the improvement from order n−2n^{-2} to order n−4n^{-4}.

  3. Prove ∥ex−AN∥∞≤2(1+e)/(3π4N3)\|e^x-A_N\|_\infty\leq 2(1+e)/(3\pi^4N^3) and give an integer NN certified to make the bound less than 10−410^{-4}.

  4. Justify one differentiation of the residual series and verify the slopes of every ANA_N. Sketch the derivative errors of raw and corrected approximants for N=8N=8. State what slope matching does not guarantee.

Original worksheet page 1: question and worked solution for 8-5-004
Show solutionHide solution

Question 4 – Solution

Strategy. Remove the endpoint-slope contribution while retaining the residual’s generally nonzero mean.

Step 1: Compute the raw data. For k=nπk=n\pi, direct integration gives mean=e−1,an=2(e(−1)n−1)1+k2.\boxed{\text{mean}=e-1,\qquad a_n=\frac{2(e(-1)^n-1)}{1+k^2}.} Every raw finite cosine sum has zero endpoint derivatives, disagreeing with f′(0)=1f'(0)=1 and f′(1)=ef'(1)=e.

Step 2: Cancel the slope contribution. The derivative ℓ′=1+(e−1)x\ell'=1+(e-1)x matches both target endpoint slopes. Two integrations by parts give its positive-frequency coefficient 2(e(−1)n−1)/k22(e(-1)^n-1)/k^2; the constant second derivative has zero cosine integral. Subtracting yields mr=56(e−1)−12,cn=−2(e(−1)n−1)k2(1+k2).\boxed{m_r=\frac 56(e-1)-\frac 12,\qquad c_n=-\frac{2(e(-1)^n-1)}{k^2(1+k^2)}.} The residual has zero endpoint derivatives, so the leading slope term cancels and fourth-power decay remains. Its mean must still be included.

Step 3: Certify the function error. The bound |cn|≤2(1+e)/(π4n4)|c_n|\leq 2(1+e)/(\pi^4n^4) gives uniform absolute convergence. The continuous piecewise smooth even extension identifies the sum with rr. Consequently ∥ex−AN∥∞≤2(1+e)π4∫N∞t−4dt=2(1+e)3π4N3.\boxed{\|e^x-A_N\|_\infty\leq\frac{2(1+e)}{\pi^4} \int_N^\infty t^{-4}dt=\frac{2(1+e)}{3\pi^4N^3}.} The choice N=7\boxed{N=7} makes this bound less than 10−410^{-4}.

Step 4: Verify the derivative behavior. Derivative coefficients are bounded by a constant times n−3n^{-3}, so that series converges uniformly. Together with convergence at one point, this justifies differentiation. Every residual partial sum has zero endpoint slopes; adding ℓ\ell gives AN′(0)=1,AN′(1)=eA_N'(0)=1,A_N'(1)=e exactly. Slope matching does not force exact endpoint values at finite NN; those are controlled by the function-error bound and become exact in the limit.

See the diagram in the original worksheet below.

Original worksheet page 2: question and worked solution for 8-5-004

Original worksheet layout. Use Enlarge or open the PDF for a closer view.