# Sum of Fourier Sine Series Not Giving Original Function

When I plug the below sum (from here) into Mathematica 12.1.1, why do I get something different from the original function ($$1 + x^2$$)? S = HoldForm[Sum[2/(n*Pi)^3*((2 L^2 - n^2*Pi^2*(1 + L^2))*(-1)^n - 2*L^2 + n^2*Pi^2)*Sin[n*Pi*x/L], {n, 1, Infinity}]]

FullSimplify[ReleaseHold[S], Assumptions -> 0 <= x <= L] • The code L = 5; S = HoldForm[Sum[ 2/(n*Pi)^3*((2 L^2 - n^2*Pi^2*(1 + L^2))*(-1)^n - 2*L^2 + n^2*Pi^2)*Sin[n*Pi*x/L], {n, 1, Infinity}]]; FullSimplify[ReleaseHold[S], Assumptions -> 0 <= x <= L]; Plot[% - x^2 - 1, {x, 0, L}] works well in version12.0. The result of FullSimplify differs from yours. – user64494 Jul 18 '20 at 14:53
• @user64494 Yes, the plot shows 0, but is there a way to get the original expression? – Leponzo Jul 18 '20 at 14:56
• My best is L=5;s = Sum[2/(n*Pi)^3*((2 L^2 - n^2*Pi^2*(1 + L^2))*(-1)^n - 2*L^2 + n^2*Pi^2)*Sin[n*Pi*x/L], {n, 1, Infinity}]; FullSimplify[D[s , {x, 3}], Assumptions -> x >= 0 && x <= L] which performs 0. – user64494 Jul 18 '20 at 15:08

## 1 Answer

According to Find the function $f(x)$ by using its fourier expansion, it looks like it is usually not possible to get $$f(x)$$ from the infinite series.

• Unfortunately, PowerExpand[ FunctionExpand[-(1/\[Pi]^3) I (-\[Pi]^2 Log[1 - E^(I \[Pi] x)] + \[Pi]^2 Log[ E^(-I \[Pi] x) (-1 + E^(I \[Pi] x))] + 2 \[Pi]^2 Log[1 + E^(I \[Pi] x)] - 2 \[Pi]^2 Log[E^(-I \[Pi] x) (1 + E^(I \[Pi] x))] - 2 PolyLog[3, -E^(-I \[Pi] x)] + 2 PolyLog[3, E^(-I \[Pi] x)] + 2 PolyLog[3, -E^(I \[Pi] x)] - 2 PolyLog[3, E^(I \[Pi] x)])]] does not work – user64494 Jul 19 '20 at 16:17