@Kitonum

g := x;

r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := x^2;

r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := x^n;

rn := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := exp(x);

r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := cos(x);

r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := sin(x);

rn := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := diff(m(x), x);

r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := diff(m(x), x$2);

r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := diff(m(x), x$k);

rn := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

same 0

g := x;

r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := x^2;

r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := x^3;

r3 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := x^4;

r4 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := x^5;

r5 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

r1 + r2 + r3 + r4 + r5;

g := diff(m(x),x);

r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := diff(m(x),x$2);

r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := diff(m(x),x$3);

r3 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := diff(m(x),x$4);

r4 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

g := diff(m(x),x$5);

r5 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

guess := sum(subs(g=x^k, rk), k=1..infinity);