I start with the following input:
f[n_] = Sum[(1+x)^j, {j,1,n}];
g[n_] := Sum[(1+x)^j, {j,1,n}]
When I try to evaluate the code above I get:
f[2]
$$ \dfrac{(1+x)(-1+(1+x)^2)}{x} $$
g[2]
$$ 1+x+(1+x)^2 $$
Why is this the case?
I start with the following input:
f[n_] = Sum[(1+x)^j, {j,1,n}];
g[n_] := Sum[(1+x)^j, {j,1,n}]
When I try to evaluate the code above I get:
f[2]
$$ \dfrac{(1+x)(-1+(1+x)^2)}{x} $$
g[2]
$$ 1+x+(1+x)^2 $$
Why is this the case?
Setthe expression is evaluated first. Mathematica can symbolically manipulateSums even whenndoes not have a value. To see this, you can evaluate the expressionSum[(1 + x)^j, {j, 1, n}]whenndoes not have a value, and see that it evaluates to the same thing as you can see inf//Definition. – Jacob Akkerboom Nov 15 '14 at 11:28f[2]//Expandandg[2]//Expand. Lastly I think the question looks quite alright :). – Jacob Akkerboom Nov 15 '14 at 11:39