Partial Sums of Fourier Series [on hold]

It does not want to plot anything? Please, help me understand why. Thank you

    f = x - Pi     p = Pi     s[n_ , x_ ] := (1/2)*Integrate[ f , {x, -p, p} ]*(1/p) +      Sum[  (1/p)*Integrate[f*Cos (k*x) , {x, -p, p}]*Sin (k*x) + (1/p)*     Integrate[f*Sin (k*x) , {x, -p, p}]*Sin (k*x) , {k, 1, n} ]      partialsums = Table[s[n, x], {n, 1, 5}];     Plot[partialsums, {x, -4, 4}] 

Replay

Functions in Mathematica get square brackets (i.e. Sin[x]), not round brackets.

f = x - Pi
p = Pi
s[n_, x_] := (1/2)*Integrate[f, {x, -p, p}]*(1/p) +
 Sum[(1/p)*Integrate[f*Cos [k*x], {x, -p, p}]*Sin [k*x] + (1/p)*
 Integrate[f*Sin [k*x], {x, -p, p}]*Sin [k*x], {k, 1, n}]

partialsums = Table[s[n, x], {n, 1, 5}];
Plot[partialsums, {x, -4, 4}]

-Pi +x

Pi

Partial Sums of Fourier Series [on hold]

Mathematica has FourierTrigSeries for this.

f = x - Pi;
partialsums = FourierTrigSeries[f, x, #] & /@ Range[5];
% // Column

Partial Sums of Fourier Series [on hold]

Plot[partialsums, {x, -4, 4}]

Partial Sums of Fourier Series [on hold]

Category: fourier analysis Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.148 (s). 12 q(s)