0

My problem is simple. I want to evaluate the series

Series[(1 + x*b - x*a)/(1 + 2*x*c - 2*x*a), {a, 0, 2}, {b, 0, 2}, {c, 
0, 2}].

Mathematica output looks like this:

series

The third variable (c) stays blue. The documentation claims that shouldn't be the case. What am I missing?

drabus
  • 427
  • 3
  • 9

1 Answers1

2

Do you want a Seriesexpansion or a Taylorpolynom of 2. degree?

With Mathematicas Series you get:

Series[(1 + x*b - x*a)/(1 + 2*x*c - 2*x*a), {a, 0, 2}, {b, 0, 2}, {c, 0, 2}] // Normal // Expand

1 + a x + b x - 2 c x + 2 a^2 x^2 + 2 a b x^2 - 6 a c x^2 - 
 2 b c x^2 + 4 c^2 x^2 + 4 a^2 b x^3 - 16 a^2 c x^3 - 8 a b c x^3 + 
 20 a c^2 x^3 + 4 b c^2 x^3 - 24 a^2 b c x^4 + 72 a^2 c^2 x^4 + 
 24 a b c^2 x^4 + 96 a^2 b c^2 x^5

With Taylor expansion:

taylor = (vars - point).# &;
init := D[f[vars], {vars, j}] /. Thread[vars -> point];
taylorPoly[m_] := Sum[1/j! Nest[taylor, init, j], {j, 0, m}]

vars = {a, b, c};
point = {0, 0, 0};
f[vars_] = (1 + x*b - x*a)/(1 + 2*x*c - 2*x*a);
taylorPoly[2] // Expand

1 + a x + b x - 2 c x + 2 a^2 x^2 + 2 a b x^2 - 6 a c x^2 - 2 b c x^2 + 4 c^2 x^2

or another method:

f[a_,b_,c_] = (1 + x*b - x*a)/(1 + 2*x*c - 2*x*a);
n = {a - a0, b - b0, c - c0};
grad = Grad[f[a0, b0, c0], {a0, b0, c0}];
hesse = D[f[a0, b0, c0], {{a0, b0, c0}, 2}];
taylor = f[a0, b0, c0] + n.grad + 1/2 n.hesse.n /. {a0 -> 0, b0 ->0, c0 -> 0} // Expand

1 + a x + b x - 2 c x + 2 a^2 x^2 + 2 a b x^2 - 6 a c x^2 - 2 b c x^2 + 4 c^2 x^2

As Kuba commented your code works fine in Mathematica 10.3.1