View in NBViewer Open in binder Download notebook View source


11.1. Séries de Fourier

using LinearAlgebra
using Plots

Séries de Fourier

Séries de Fourier em uma dimensão espacial

\[ s(x) = \frac{a_0}{2} + \sum_{k=1}^\infty a_k \cos\left(\frac{2k\pi x}{L}\right) + \sum_{k=1}^\infty b_k \sin\left(\frac{2k\pi x}{L}\right), \quad \forall x\in \mathbb{R}. \] \[ s(x) = \sum_{k\in \mathbb{Z}} c_k e^{\frac{i 2k\pi x}{L}}. \]

Base de funções

\[ \begin{align*} & \int_{-L/2}^{L/2} \cos\left(\frac{2k\pi x}{L}\right)\cos\left(\frac{2m\pi x}{L}\right)\;\mathrm{d}x = 0, & & \forall k, m = 0, 1, \ldots, \; k\neq m, \\ & \int_{-L/2}^{L/2} \cos\left(\frac{2k\pi x}{L}\right)\sin\left(\frac{2m\pi x}{L}\right)\;\mathrm{d}x = 0, & & \forall k, m = 0, 1, \ldots, \\ & \int_{-L/2}^{L/2} \cos\left(\frac{2k\pi x}{L}\right)^2\;\mathrm{d}x = L, & & k = 0, \\ & \int_{-L/2}^{L/2} \cos\left(\frac{2k\pi x}{L}\right)^2\;\mathrm{d}x = \frac{L}{2}, & & \forall k= 1, 2, \ldots, \\ & \int_{-L/2}^{L/2} \sin\left(\frac{2k\pi x}{L}\right)^2\;\mathrm{d}x = \frac{L}{2}, & & \forall k=1, 2, \ldots. \end{align*} \] \[ \langle f, g \rangle = \int_{-L/2}^{L/2} f(x)g(x)\;\mathrm{d} x \]

e norma

\[ \|f\| = \left(\int_{-L/2}^{L/2} |f(x)|^2\;\mathrm{d} x\right)^{1/2}. \]

Coeficientes

\[ \begin{align*} a_0 & = \frac{1}{\|w_0\|^2}\langle f, w_0\rangle = \frac{1}{L} \int_{-L/2}^{L/2} f(x) \;\mathrm{d}x, \\ a_k & = \frac{1}{\|w_{c,k}\|^2}\langle f, w_{c,k} \rangle = \frac{2}{L}\int_{-L/2}^{L/2} f(x)\cos\left(\frac{2k\pi x}{L}\right) \;\mathrm{d}x, & & k = 1, 2, \ldots, \\ b_k & = \frac{1}{\|w_{s,k}\|^2}\langle f, w_{s,k} \rangle = \frac{2}{L}\int_{-L/2}^{L/2} f(x)\sin\left(\frac{2k\pi x}{L}\right) \;\mathrm{d}x, & & k = 1, 2, \ldots. \end{align*} \] \[ w_0(x) = 1, \quad w_{c,k} = \cos\left(\frac{2k\pi x}{L}\right), \quad w_{s,k} = \sin\left(\frac{2k\pi x}{L}\right), \quad k = 1, 2, \ldots. \] \[ f = c_0 w_0 + \sum_{k=1}^\infty c_{c,k} w_{c,k} + \sum_{k=1}^\infty c_{s,k} w_{s,k}. \\ \]

Versão ortonormal

\[ \tilde w_0(x) = \frac{1}{\sqrt{L}}, \quad \tilde w_{c,k} = \sqrt{\frac{2}{L}}\cos\left(\frac{2k\pi x}{L}\right), \quad \tilde w_{s,k} = \sqrt{\frac{2}{L}}\sin\left(\frac{2k\pi x}{L}\right), \quad k = 1, 2, \ldots. \] \[ \begin{align*} \tilde a_0 & = \langle f, \tilde w_0\rangle = \frac{1}{\sqrt{L}} \int_{-L}^L f(x) \;\mathrm{d}x, \\ \tilde a_k & = \langle f, \tilde w_{c,k} \rangle = \sqrt{\frac{2}{L}}\int_{-L}^L f(x)\cos\left(\frac{2k\pi x}{L}\right) \;\mathrm{d}x, & & k = 1, 2, \ldots, \\ \tilde b_k & = \sqrt{\frac{2}{L}}\int_{-L/2}^{L/2} f(x)\sin\left(\frac{k\pi x}{L}\right) \;\mathrm{d}x, & & k = 1, 2, \ldots. \end{align*} \] \[ f = \tilde c_0 \tilde w_0 + \sum_{k=1}^\infty \tilde c_{c,k} \tilde w_{c,k} + \sum_{k=1}^\infty \tilde c_{s,k} \tilde w_{s,k}. \\ \]

Coeficientes da série de exponenciais complexas

\[ f(x) = \sum_{k\in \mathbb{Z}} c_k e^{\frac{i 2k\pi x}{L}}. \] \[ c_k = \frac{1}{L}\int_{-L/2}^{L/2} f(x)e^{-\frac{i 2k\pi x}{L}}\;\mathrm{d}x. \]

Série de Fourier de funções definitas em intervalos limitados

\[ \begin{align*} a_0 & = \frac{1}{L} \int_{0}^{L} f(x) \;\mathrm{d}x, \\ a_k & = \frac{2}{L}\int_{0}^{L} f(x)\cos\left(\frac{2k\pi x}{L}\right) \;\mathrm{d}x, & & k = 1, 2, \ldots, \\ b_k & = \frac{2}{L}\int_{0}^{L} f(x)\sin\left(\frac{2k\pi x}{L}\right) \;\mathrm{d}x, & & k = 1, 2, \ldots. \end{align*} \] \[ \begin{align*} a_0 & = \int_{0}^{1} f(x) \;\mathrm{d}x, \\ a_k & = 2\int_{0}^{1} f(x)\cos\left(2k\pi x\right) \;\mathrm{d}x, & & k = 1, 2, \ldots, \\ b_k & = 2\int_{0}^{1} f(x)\sin\left(2k\pi x\right) \;\mathrm{d}x, & & k = 1, 2, \ldots. \end{align*} \] \[ \begin{align*} a_0 & = \frac{1}{2\pi} \int_{0}^{2\pi} f(x) \;\mathrm{d}x, \\ a_k & = \frac{1}{\pi}\int_{0}^{2\pi} f(x)\cos\left(kx\right) \;\mathrm{d}x, & & k = 1, 2, \ldots, \\ b_k & = \frac{1}{\pi}\int_{0}^{2\pi} f(x)\sin\left(kx\right) \;\mathrm{d}x, & & k = 1, 2, \ldots. \end{align*} \]

Série de cossenos

\[ f(x) = \frac{a_0}{2} + \sum_{k=1}^\infty a_k \cos\left(\frac{2k \pi x}{L}\right), \quad x\in [-L/2,L/2]. \] \[ \begin{align*} a_0 & = \frac{2}{L} \int_0^{L/2} f(x) \;\mathrm{d}x, \\ a_k & = \frac{4}{L}\int_0^{L/2} f(x)\cos\left(\frac{2k\pi x}{L}\right) \;\mathrm{d}x, & & k = 1, 2, \ldots. \end{align*} \] \[ \bar f(x) = \begin{cases} f(x), & x\in [0, L], \\ f(-x), & x\in [-L, 0). \end{cases} \] \[ \cos\left(\frac{2k\pi x}{\tilde L}\right) = \cos\left(\frac{k\pi x}{L}\right), \quad k=1,2,\ldots. \]

Série de senos

\[ f(x) = \sum_{k=1}^\infty b_k \sin\left(\frac{2k \pi x}{L}\right), \quad x\in [-L/2,L/2]. \] \[ b_k = \frac{4}{L}\int_0^{L/2} f(x)\sin\left(\frac{2k\pi x}{L}\right) \;\mathrm{d}x, k = 1, 2, \ldots. \] \[ \bar f(x) = \begin{cases} f(x), & x\in [0, L], \\ -f(-x), & x\in [-L, 0). \end{cases} \] \[ \sin\left(\frac{2k\pi x}{\tilde L}\right) = \sin\left(\frac{k\pi x}{L}\right), \quad k=1,2,\ldots. \]

Funções se anulando nos extremos

\[ \tilde f(x) = \begin{cases} f(x), & 0\leq x \leq L, \\ -f(-x), & L \leq x < 0. \end{cases} \]

Funções com derivadas se anulando nos extremos

Representação complexa

\[ e^{\frac{\pm 2ik\pi x}{L}} = \cos\left(\frac{2k\pi x}{L}\right) \pm i\sin\left(\frac{2k\pi x}{L}\right) \] \[ c_k e^{\frac{2ik\pi x}{L}} + c_{-k} e^{\frac{-2ik\pi x}{L}} = (c_k + c_{-k}) \cos\left(\frac{2k\pi x}{L}\right) + i (c_k - c_{-k})\sin\left(\frac{2k\pi x}{L}\right) \] \[ c_k e^{\frac{2ik\pi x}{L}} + c_{-k} e^{\frac{-2ik\pi x}{L}} = a_k \cos\left(\frac{2k\pi x}{L}\right) + b_k\sin\left(\frac{2k\pi x}{L}\right). \] \[ c_k + c_{-k} = a_k \in \mathbb{R}, \quad i(c_k - c_{-k}) = b_k \in \mathbb{R}. \] \[ \begin{align*} c_k + c_{-k} & = \alpha_k + \alpha_{-k} + i(\beta_k + \beta_{-k}) \quad \Longrightarrow \quad \beta_k = -\beta_{-k} \\ i(c_k - c_{-k}) & = - (\beta_k - \beta_{-k}) + i(\alpha_k - \alpha_{-k}) \quad \Longrightarrow \quad \alpha_k = \alpha_{-k} \end{align*} \] \[ c_{-k} = \overline{c_k}. \] \[ c_0 = \frac{a_0}{2}, \quad c_k = \frac{a_k + ib_k}{2}, \quad c_{-k} = \frac{a_k - ib_k}{2}, \qquad k=1, 2, \ldots. \] \[ a_0 = 2c_0, \quad a_k = 2\mathrm{Re}(c_k), \quad b_k = 2\mathrm{Im}(c_k), \qquad k=1,2,\ldots. \]

Fase da onda

\[ \sin\left(\frac{2k\pi x}{L}\right) = \cos\left(\varphi + \frac{2k\pi x}{L}\right), \quad \varphi = \frac{\pi}{2}. \] \[ \begin{align*} A\sin\left(\frac{2k\pi x}{L}\right) + B \cos\left(\frac{2k\pi x}{L}\right) & = \sqrt{A^2+B^2}\left(\alpha\sin\left(\frac{2k\pi x}{L}\right) + \beta \cos\left(\frac{2k\pi x}{L}\right) \right) \\ & = \sqrt{A^2+B^2}\left(\cos\varphi\sin\left(\frac{2k\pi x}{L}\right) + \sin\varphi \cos\left(\frac{2k\pi x}{L}\right) \right) \\ & = \sqrt{A^2+B^2}\sin\left(\varphi + \frac{2k\pi x}{L}\right). \end{align*} \] \[ \begin{align*} A\sin\left(\frac{2k\pi x}{L}\right) + B \cos\left(\frac{2k\pi x}{L}\right) & = \sqrt{A^2+B^2}\left(\alpha\sin\left(\frac{2k\pi x}{L}\right) + \beta \cos\left(\frac{2k\pi x}{L}\right) \right) \\ & = \sqrt{A^2+B^2}\left(-\sin\varphi\sin\left(\frac{2k\pi x}{L}\right) + \cos\varphi \cos\left(\frac{2k\pi x}{L}\right) \right) \\ & = \sqrt{A^2+B^2} \cos\left(\varphi + \frac{2k\pi x}{L}\right). \end{align*} \]

Amplitude

\[ a_k\sin\left(\frac{2k\pi x}{L}\right) + b_k \cos\left(\frac{2k\pi x}{L}\right), \quad k=1, 2, \ldots. \] \[ R = \sqrt{a_k^2 + b_k^2} \] \[ a_0 = 2c_0, \quad a_k = 2\mathrm{Re}(c_k), \quad b_k = 2\mathrm{Im}(c_k), \qquad k=1,2,\ldots. \] \[ R = \sqrt{4\mathrm{Re}(c_k)^2 + 4\mathrm{Im}(c_k)^2} = 2 |c_k|, \quad k=1,2,\ldots. \] \[ R = \frac{|a_0|}{2} = |c_0| \]

Convergência

Convergência em \(L^2\)

Convergência em \(L^2\) da série de senos

\[ w_{s,k}(x) = \sin\left(\frac{k \pi x}{L}\right), \quad 0\leq x \leq L. \] \[ \langle f, g \rangle = \int_0^L f(x)g(x)\;\mathrm{d} x, \qquad \|f\| = \left(\int_0^L |f(x)|^2\;\mathrm{d} x\right)^{1/2}. \]

Coeficientes de Fourier e somas parciais

\[ \hat f_k = \frac{1}{\|w_{s,k}\|^2}\langle f, w_{s,k} \rangle, \quad k=1, 2, \ldots. \] \[ S_m(f) = \sum_{k=1}^m \hat f_k w_{s,k}. \]

Somas parciais como projeções ortogonais

\[ \langle f - S_m(f), v \rangle = 0, \qquad \forall \in E_m. \] \[ \langle f - \sum_{k=1}^m \hat f_k w_{s,k}, \sum_{j=1} c_j w_{s,j} \rangle = 0, \]

para quaisquer \(c_1, \ldots, c_m\in \mathbb{R}\).

\[ \begin{align*} \langle f - \sum_{k=1}^m \hat f_k w_{s,k}, \sum_{j=1}^m c_j w_{s,j} \rangle & = \sum_{j=1}^m c_j\langle f, w_{s,j}\rangle - \sum_{k=1}^m \hat f_kc_k\|w_{s,k}\|^2 \\ & = \sum_{k=1}^m c_k \left(\langle f, w_{s,j}\rangle - \hat f_k\|w_{s,k}\|^2 \right). \end{align*} \]

Somas parciais como melhores aproximações

\[ \begin{align*} \|f - S_m(f)\|^2 & = \|f - S_n(f) + S_n(f) - S_m(f)\|^2 \\ & = \|f - S_n(f)\|^2 + 2\langle f - S_n(f), S_n(f) - S_m(f) \rangle + \|S_n(f) - S_m(f)\|^2. \end{align*} \] \[ \|f - S_m(f)\|^2 = \|f - S_n(f)\|^2 + \|S_n(f) - S_m(f)\|^2 \geq \|f - S_n(f)\|^2. \] \[ \|f - S_m(f)\|^2 > \|f - S_n(f)\|^2. \]

Convergência

\[ \begin{align*} \hat f_k & = \frac{1}{L} \int_0^L f(x)\sin\left(\frac{k\pi x}{L}\right) \;\mathrm{d}x \\ & = - \left.\frac{f(x)}{k\pi}\cos\left(\frac{k\pi x}{L}\right)\right|_{x=0}^L + \frac{1}{k\pi}\int_0^L f'(x)\cos\left(\frac{k\pi x}{L}\right)\;\mathrm{d}x \\ & = - \frac{f(L)}{k\pi}(-1)^k + \frac{f(0)}{k\pi} + \frac{1}{k\pi}\int_0^L f'(x)\cos\left(\frac{k\pi x}{L}\right)\;\mathrm{d}x. \end{align*} \] \[ |\hat f_k| \leq \frac{1}{k\pi}\left( \max\{|f(0)|, |f(L)|\} + \sqrt{L}\|f'\| \right) = \mathcal{O}\left(\frac{1}{k}\right). \] \[ \begin{align*} \|S_n(f) - S_m(f)\|^2 & = \| \sum_{k=m+1}^n \hat f_k w_{s,k} \|^2 = \sum_{k=m+1}^n |\hat f_k|^2 \|w_{s,k}\|^2 \\ & \leq \sum_{k=m+1}^n \frac{\|f'\|^2}{k^2\pi^2} \leq \sum_{k=m+1}^\infty \frac{\|f'\|^2}{k^2\pi^2} \rightarrow 0, \quad m\rightarrow \infty. \end{align*} \] \[ S_m(f) \rightarrow s(s), \quad m\rightarrow \infty. \]

Convergência para \(f\)

Exemplos

L = 1.0
x = 0.0:0.01:L
ν₁ = 1/(2L) # smallest frequency, inverse of the largest period λ = 2L of sin(kπx/L), for wavenumber k=1
nothing
M = 100
ν = ν₁ * (1:M)
nothing

Função para cálculo dos coeficientes e das somas parciais da séries

"""
    serie_senos(f::Vector{T}, x::Union{Vector{T}, AbstractRange{T}}, L::T, M::Int64) where {T<:Float64}

Retorna os `M` primeiros coeficientes e somas parciais da série de senos da função `f`.

Assume-se que a função `f` está definida na malha `x` e que a malha `x` é uniforme e
se estende de `0.0` a `L`.

Retorna o par `f̂, S`, onde `f̂::Vector{Float64}` contém os coeficientes da série
e onde as colunas de `S:Matrix{Float64}` contêm as somas parciais da série.
"""
function serie_senos(f::Vector{T}, x::Union{Vector{T}, AbstractRange{T}}, L::T, M::Int64) where {T<:Float64}
    dx = L / (length(x) - 1)
    f̂ = fill(0.0, M) # prealocando vetor para os coeficientes da série de senos
    S = fill(0.0, length(x), M) # prealocando matriz cujas colunas serão as somas parciais da séries
    for m = 1:M
        f̂[m] = (2/L) * sum(f ⋅ sin.(m * π * x / L)) * dx
        if m == 1
            S[:,m] = f̂[m] * sin.(m * π * x / L)
        else
            S[:,m] = S[:,m-1] .+ f̂[m] * sin.(m * π * x / L)
        end
    end
    return f̂, S
end
Main.##WeaveSandBox#3798.serie_senos

Função suave

\[ f(x) = x^2(L-x)^2. \]
fpol = x.^2 .* (L .- x).^2 # função discretizada
fpol_str = "x²(L-x²)"
f̂pol, Spol = serie_senos(fpol, x, L, M)
([0.0556930353147588, 3.0545193924116225e-18, -0.008265038705959678, 8.3531
00112643008e-19, -0.00196370725860613, 9.173705631942974e-19, -0.0007335498
612589687, -3.3867765363015947e-19, -0.0003486041924548693, 1.2077334575130
715e-18  …  -1.4517390709079492e-7, -4.2859867131067597e-19, -1.11723880302
19007e-7, 3.941549235435271e-18, -7.917319701423036e-8, 3.496856938126763e-
18, -4.725419758099793e-8, -5.403429846574312e-17, -1.5709988264326937e-8, 
-1.8523187059874747e-18], [0.0 0.0 … 0.0 0.0; 0.0017493605146015794 0.00174
93605146015796 … 9.800999999984776e-5 9.800999999984776e-5; … ; 0.001749360
5146015763 0.0017493605146015761 … 9.800999999982142e-5 9.800999999982142e-
5; 6.820429743301986e-18 6.8204297433019855e-18 … -2.7134784824953443e-19 -
2.713478482495381e-19])
plot(x, fpol, title="Aproximações por séries de senos de f(x) = $fpol_str", titlefont=10,
    xlabel="x", ylabel="y", label="y=f(x)", legend=:topright)
plot!(x, Spol[:,1:3:10], label = hcat(["m=$m" for m in 1:3:10]...), linestyle=:dash)
plot(x, fpol, title="Aproximações por séries de Fourier de f(x) = min(2x, 2L-2x)", titlefont=10,
    xlabel="x", ylabel="y", label="y=f(x)", legend=:topright)
plot!(x, Spol[:,10:20:50], label = hcat(["m=$m" for m in 10:20:50]...), linestyle=:dash)
scatter(ν, abs.(f̂pol),
    title="Decaimento do valor absoluto dos coeficientes de Fourier", titlefont=10,
    xlabel="ν=k/L", ylabel="|f̂|", label=false, xscale=:log10, yscale=:log10
)

Onda triangular

ftri = L .- 2*abs.(x .- L/2)
ftri_str = "L-2|x-L/2|"
f̂tri, Stri = serie_senos(ftri, x, L, M)
for mrange in (1:3:10, 10:20:50, 40:20:100)
    p = plot(x, ftri, title="Aproximações por séries de senos de f(x) = $ftri_str", titlefont=10,
        xlabel="x", ylabel="y", label="y=f(x)", legend=:topright)
    plot!(p, x, Stri[:,mrange], label = hcat(["m=$m" for m in mrange]...), linestyle=:dash)
    display(p)
end

Decaimento dos coeficientes de Fourier

scatter(ν, abs.(f̂tri),
    title="Decaimento do valor absoluto dos coeficientes de Fourier", titlefont=10,
    xlabel="ν=2k/L", ylabel="|f̂k|", label=false, xscale=:log10, yscale=:log10
)

Onda quadrada e o fenômeno de Gibbs

fquad = ifelse.(L/4 .≤ x .≤ 3L/4, 1.0, 0.0)
fquad_str = "χ_{[L/4, 3L/4]}" # A função caraterística do intervalo [L/4, 3L/4]
f̂quad, Squad = serie_senos(fquad, x, L, M)
for mrange in (1:3:10, 10:20:50, 40:20:100)
    p = plot(x, fquad, title="Aproximações por séries de senos de f(x) = $fquad_str", titlefont=10,
        xlabel="x", ylabel="y", label="y=f(x)", legend=:topright)
    plot!(p, x, Squad[:,mrange], label = hcat(["m=$m" for m in mrange]...), linestyle=:dash)
    display(p)
end

scatter(ν, abs.(f̂quad),
    title="Decaimento do valor absoluto dos coeficientes de Fourier", titlefont=10,
    xlabel="ν=2k/L", ylabel="|f̂k|", label=false, xscale=:log10, yscale=:log10)
scatter(ν, abs.(f̂pol), xscale=:log10, yscale=:log10, 
    title="Decaimento do valor absoluto dos coeficientes de Fourier", titlefont=10,
    xlabel="ν=2k/L", ylabel="|f̂k|", label="suave",
    legend = :bottomleft
)
scatter!(ν, abs.(f̂tri), xscale=:log10, yscale=:log10,
    xlabel="ν=2k/L", ylabel="|f̂k|", label="triangular"
)
scatter!(ν, abs.(f̂quad), xscale=:log10, yscale=:log10,
    xlabel="ν=2k/L", ylabel="|f̂k|", label="quadrado"
)
plot!([first(ν), last(ν)], abs(first(f̂tri)) ./ [first(ν), last(ν)],
    label = "decaimento linear"
)
plot!([first(ν), last(ν)], abs(first(f̂tri)) ./ [first(ν)^2, last(ν)^2],
    label = "decaimento quadrático"
)
plot!([first(ν), last(ν)], abs(first(f̂tri)) ./ [first(ν)^3, last(ν)^3],
    label = "decaimento cúbico"
)
decai_pol = abs.(f̂pol)
decai_tri = abs.(f̂tri)
decai_quad = abs.(f̂quad)
for j in M-1:-1:1
    decai_pol[j] = max(decai_pol[j], decai_pol[j+1])
    decai_tri[j] = max(decai_tri[j], decai_tri[j+1])
    decai_quad[j] = max(decai_quad[j], decai_quad[j+1])
end
plot(ν, decai_pol, yaxis=:log10, xaxis=:log10,
    title="Decaimento do valor absoluto dos coeficientes de Fourier", titlefont=10,
    xlabel="ν=2k/L", ylabel="max{|f̂j|, j≥ k}", label="polinomial", legend=:bottomleft) 
plot!(ν, decai_tri, label="triangular", yaxis=:log10, xaxis=:log10) 
plot!(ν, decai_quad, label="quadrado", yaxis=:log10, xaxis=:log10)

Combinação de senos

fcs = 5sin.(π * 2ν₁ * x) .- 2sin.(3π * 2ν₁ * x) .+ 5sin.(7π * 2ν₁ * x) .+ 2sin.(18π * 2ν₁ * x)
fcs_str = "senos com frequências ν₁, 3ν₁, 7ν₁ e 18ν₁" # A função caraterística do intervalo [L/4, 3L/4]
f̂cs, Scs = serie_senos(fcs, x, L, M)
for mrange in (1:3:10, 14:17, 18:2:30)
    p = plot(x, fcs, title="Aproximações por séries de senos de f(x) = $fcs_str", titlefont=9,
        xlabel="x", ylabel="y", label="y=f(x)", legend=:topright)
    plot!(p, x, Scs[:,mrange], label = hcat(["m=$m" for m in mrange]...), linestyle=:dash)
    display(p)
end

scatter(ν, f̂cs,
    title="Coeficientes de Fourier", titlefont=10,
    xlabel="ξ=πk/L", ylabel="f̂k", label=false)

Exercícios

  1. Escreva a expansão em série de senos e cossenos de uma função \(f\) definida em um intervalo \([L_0, L_1]\), incluindo a fórmula dos coeficientes.

  2. Escreva a expansão em série apenas de senos de uma função \(f\) definida em um intervalo \([L_0, L_1]\), incluindo a fórmula dos coeficientes.

  3. Escreva a expansão em série apenas de cossenos de uma função \(f\) definida em um intervalo \([L_0, L_1]\), incluindo a fórmula dos coeficientes.

  4. Calcule explicitamente os coeficientes da série de senos da função triangular \(f(x) = L-2|x-L/2|\), \(0\leq x \leq L\), \(L>0\), e observe que todos os coeficientes \(\hat f_k\) com \(k\) par se anulam.

  5. Mostre que se \(f:[0,L]\rightarrow \mathbb{R}\) é duas vezes continuamente diferenciável em \([0,L]\) e \(f(0)=f(L)=0\), então os coeficientes da série de senos de \(f\) decaem da ordem \(k^{-2}\).

  6. Implemente uma função para o cálculo numérico da expansão em série de cossenos, analoga à feita acima para a série de senos, e calcule os coeficientes e as somas parciais das séries de cossenos das funções trabalhadas acima (polinômio, onda triangular e onda quadrada).