4 added 63 characters in body edited Jan 10 '14 at 5:32 Nasser 62.4k44 gold badges9393 silver badges217217 bronze badges You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  A quick Manipulate: Manipulate[ r = FourierSeries[f[x], x, n]; Show[Plot[r, {x, -2 Pi, 2 Pi}, Frame -> True], Plot[f[x], {x, -2 Pi, 2 Pi}, PlotStyle -> {Thick, Red}]], Grid[{ {Control[{{n, 3, "how many terms?"}, 1, 20, 1}], Dynamic[n]} }], ContinuousAction -> False, SynchronousUpdating -> True, Initialization :> ( f[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}] ) ]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  A quick Manipulate: Manipulate[ r = FourierSeries[f[x], x, n]; Show[Plot[r, {x, -2 Pi, 2 Pi}, Frame -> True], Plot[f[x], {x, -2 Pi, 2 Pi}, PlotStyle -> {Thick, Red}]], Grid[{ {Control[{{n, 3, "how many terms?"}, 1, 20, 1}], Dynamic[n]} }], ContinuousAction -> False, SynchronousUpdating -> True, Initialization :> ( f[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}] ) ]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  A quick Manipulate: Manipulate[ r = FourierSeries[f[x], x, n]; Show[Plot[r, {x, -2 Pi, 2 Pi}, Frame -> True], Plot[f[x], {x, -2 Pi, 2 Pi}, PlotStyle -> {Thick, Red}]], Grid[{ {Control[{{n, 3, "how many terms?"}, 1, 20, 1}], Dynamic[n]} }], ContinuousAction -> False, SynchronousUpdating -> True, Initialization :> ( f[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}] ) ]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. 3 added 564 characters in body edited Jan 10 '14 at 5:20 Nasser 62.4k44 gold badges9393 silver badges217217 bronze badges You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  A quick Manipulate: Manipulate[ r = FourierSeries[f[x], x, n]; Show[Plot[r, {x, -2 Pi, 2 Pi}, Frame -> True], Plot[f[x], {x, -2 Pi, 2 Pi}, PlotStyle -> {Thick, Red}]], Grid[{ {Control[{{n, 3, "how many terms?"}, 1, 20, 1}], Dynamic[n]} }], ContinuousAction -> False, SynchronousUpdating -> True, Initialization :> ( f[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}] ) ]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  A quick Manipulate: Manipulate[ r = FourierSeries[f[x], x, n]; Show[Plot[r, {x, -2 Pi, 2 Pi}, Frame -> True], Plot[f[x], {x, -2 Pi, 2 Pi}, PlotStyle -> {Thick, Red}]], Grid[{ {Control[{{n, 3, "how many terms?"}, 1, 20, 1}], Dynamic[n]} }], ContinuousAction -> False, SynchronousUpdating -> True, Initialization :> ( f[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}] ) ]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. 2 added 216 characters in body edited Jan 10 '14 at 5:08 Nasser 62.4k44 gold badges9393 silver badges217217 bronze badges You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. You examples are easy, I was hoping for harder ones ;) This is from the definition. f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. You examples are easy, I was hoping for harder ones ;) This is from the definition. f3[x_] := Piecewise[{{1 - x^2 , x < 0}, {1 + x^2, x > 0}}]; FourierSeries[f3[x], x, 3]  And if you meant them to be different functions: f1[x_] := Piecewise[{{1 - x^2 , x < 0}, {0, True}}]; f2[x_] := Piecewise[{{1 + x^2 , x > 0}, {0, True}}]; FourierSeries[f1[x], x, 3]  FourierSeries[f2[x], x, 3]  You can use the definition of the $$c_k$$ also by using FourierParameters to make it match the textbook you are using. So make sure to look at FourierParameters and adjust it as needed else you'll get different looking result from the textbook if the textbook does not use the default setting used by Mathematica. 1 answered Jan 10 '14 at 4:58 Nasser 62.4k44 gold badges9393 silver badges217217 bronze badges