Plot[{Sum[BesselJ[0, 2 n x]/n^2, {n, 1, 30}], \[Pi]^2/6 - 2 x + x^2/2}, {x, -2, 5}]