求函数$f(x)=\frac{1}{2}+\frac{\pi}{4}\sin x$的余弦展开式及无穷级数和,咨询概念疑问
Hey there! Your first instinct is totally correct—when someone asks for a cosine expansion of a function on $[0,\pi)$, we're talking about a Fourier series consisting only of constant and cosine terms. This comes from extending the original function to an even function on $[-\pi,\pi]$ (called an even extension), which automatically eliminates all sine terms. The general form of such an expansion is:
$$f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty}a_n\cos nx$$
Where the coefficients are calculated using these formulas (we only need to integrate over $[0,\pi]$ for even extensions):
$$a_0 = \frac{2}{\pi}\int_{0}^{\pi}f(x)dx$$
$$a_n = \frac{2}{\pi}\int_{0}^{\pi}f(x)\cos nx dx \quad (n \geq 1)$$
Step 1: Compute the Cosine Expansion of $f(x)$
Let's calculate each coefficient step by step.
Calculate $a_0$
$$
\begin{align*}
a_0 &= \frac{2}{\pi}\int_{0}^{\pi}\left(\frac{1}{2} + \frac{\pi}{4}\sin x\right)dx \
&= \frac{2}{\pi}\left[\frac{1}{2}x - \frac{\pi}{4}\cos x\right]_0^{\pi} \
&= \frac{2}{\pi}\left(\frac{\pi}{2} - \frac{\pi}{4}\cos\pi + \frac{\pi}{4}\cos0\right) \
&= \frac{2}{\pi}\left(\frac{\pi}{2} + \frac{\pi}{4} + \frac{\pi}{4}\right) \
&= 2
\end{align*}
$$
Calculate $a_n$ ($n \geq 1$)
Split the integral into two parts:
$$
a_n = \frac{2}{\pi}\left(\frac{1}{2}\int_{0}^{\pi}\cos nx dx + \frac{\pi}{4}\int_{0}^{\pi}\sin x\cos nx dx\right)
$$
First integral: $\int_{0}^{\pi}\cos nx dx = \left[\frac{\sin nx}{n}\right]_0^{\pi} = 0$ (since $\sin n\pi = 0$ for all integer $n$).
For the second integral, use the product-to-sum identity: $\sin x\cos nx = \frac{1}{2}[\sin(n+1)x - \sin(n-1)x]$.
Case 1: $n = 1$
$$
\int_{0}^{\pi}\sin x\cos x dx = \frac{1}{2}\int_{0}^{\pi}\sin2x dx = \frac{1}{2}\left[-\frac{\cos2x}{2}\right]_0^{\pi} = 0
$$
So $a_1 = 0$.
Case 2: $n \geq 2$
$$
\begin{align*}
\int_{0}^{\pi}\sin x\cos nx dx &= \frac{1}{2}\int_{0}^{\pi}[\sin(n+1)x - \sin(n-1)x]dx \
&= \frac{1}{2}\left[-\frac{\cos(n+1)x}{n+1} + \frac{\cos(n-1)x}{n-1}\right]0^{\pi} \
&= \frac{1}{2}\left[-\frac{(-1)^{n+1}}{n+1} + \frac{(-1)^{n-1}}{n-1} + \frac{1}{n+1} - \frac{1}{n-1}\right]
\end{align*}
$$
Note that $(-1)^{n-1} = (-1)^{n+1}$, so substitute that in:
$$
\begin{align*}
&= \frac{1}{2}\left[(-1)^{n+1}\left(\frac{-1}{n+1} + \frac{1}{n-1}\right) + \frac{(n-1)-(n+1)}{(n+1)(n-1)}\right] \
&= \frac{1}{2}\left[(-1){n+1}\cdot\frac{2}{n2-1} - \frac{2}{n^2-1}\right] \
&= \frac{(-1)^{n+1} - 1}{n^2-1}
\end{align*}
$$
This is 0 when $n$ is odd (since $(-1)^{n+1}=1$) and $\frac{-2}{n^2-1}$ when $n$ is even. Let $n=2k$ (for $k\geq1$), then:
$$
a{2k} = \frac{2}{\pi} \cdot \frac{\pi}{4} \cdot \frac{-2}{(2k)^2-1} = -\frac{1}{4k^2-1}
$$
Final Cosine Expansion
Putting it all together, since all odd $a_n$ (except $a_0$) are 0, we get:
$$
\frac{1}{2} + \frac{\pi}{4}\sin x = 1 - \sum_{k=1}{\infty}\frac{\cos2kx}{4k2-1} \quad \text{for } x \in [0,\pi)
$$
Step 2: Sum the Series $\sum_{k=1}{\infty}\frac{1}{4k2-1}$
We can evaluate this series by plugging in a convenient $x$ value where the cosine terms simplify. Let's use $x=0$:
- Left-hand side: $f(0) = \frac{1}{2} + \frac{\pi}{4}\sin0 = \frac{1}{2}$
- Right-hand side: $1 - \sum_{k=1}{\infty}\frac{\cos0}{4k2-1} = 1 - \sum_{k=1}{\infty}\frac{1}{4k2-1}$
Set them equal:
$$
\frac{1}{2} = 1 - \sum_{k=1}{\infty}\frac{1}{4k2-1}
$$
Rearranging gives:
$$
\sum_{k=1}{\infty}\frac{1}{4k2-1} = 1 - \frac{1}{2} = \frac{1}{2}
$$
内容的提问来源于stack exchange,提问作者cdummie

