I'm trying to collect all the terms in an expression with the same
second partial derivative but it doesn't seem to be working.
I can't figure out why.
Here is my code....
# ============================================================
function("xp yp zp tp f")
var("x y z t v c")
xp = (x - v * t) / sqrt(1 - v^2 / c^2)
yp = y
zp = z
tp = (t - v * x / c^2) / sqrt(1 - v^2 / c^2)
e = derivative(f(xp, yp, zp, tp), x, 2) + derivative(f(xp, yp, zp, tp), y,
2) + derivative(f(xp, yp, zp, tp), z, 2) - derivative(f(xp, yp, zp, tp), t,
2) / c^2
e.collect(derivative(f(xp, yp, zp, tp), x, 2))
# ============================================================
Here is the output. I added spaces at a subtraction to make it easy to see
there are TWO of those D[0, 0](f) terms (each at the beginning of the
sections).
(D[0, 0](f)(-(t*v - x)/sqrt(-v^2/c^2 + 1), y, z, (t -
v*x/c^2)/sqrt(-v^2/c^2 + 1))/sqrt(-v^2/c^2 + 1) - v*D[0, 3](f)(-(t*v -
x)/sqrt(-v^2/c^2 + 1), y, z, (t - v*x/c^2)/sqrt(-v^2/c^2 +
1))/(c^2*sqrt(-v^2/c^2 + 1)))/sqrt(-v^2/c^2 + 1) - v*(D[0, 3](f)(-(t*v -
x)/sqrt(-v^2/c^2 + 1), y, z, (t - v*x/c^2)/sqrt(-v^2/c^2 +
1))/sqrt(-v^2/c^2 + 1) - v*D[3, 3](f)(-(t*v - x)/sqrt(-v^2/c^2 + 1), y, z,
(t - v*x/c^2)/sqrt(-v^2/c^2 + 1))/(c^2*sqrt(-v^2/c^2 +
1)))/(c^2*sqrt(-v^2/c^2 + 1))
-
((v*D[0, 0](f)(-(t*v - x)/sqrt(-v^2/c^2 + 1), y, z, (t -
v*x/c^2)/sqrt(-v^2/c^2 + 1))/sqrt(-v^2/c^2 + 1) - D[0, 3](f)(-(t*v -
x)/sqrt(-v^2/c^2 + 1), y, z, (t - v*x/c^2)/sqrt(-v^2/c^2 +
1))/sqrt(-v^2/c^2 + 1))*v/sqrt(-v^2/c^2 + 1) - (v*D[0, 3](f)(-(t*v -
x)/sqrt(-v^2/c^2 + 1), y, z, (t - v*x/c^2)/sqrt(-v^2/c^2 +
1))/sqrt(-v^2/c^2 + 1) - D[3, 3](f)(-(t*v - x)/sqrt(-v^2/c^2 + 1), y, z, (t
- v*x/c^2)/sqrt(-v^2/c^2 + 1))/sqrt(-v^2/c^2 + 1))/sqrt(-v^2/c^2 + 1))/c^2
+ D[1, 1](f)(-(t*v - x)/sqrt(-v^2/c^2 + 1), y, z, (t -
v*x/c^2)/sqrt(-v^2/c^2 + 1)) + D[2, 2](f)(-(t*v - x)/sqrt(-v^2/c^2 + 1), y,
z, (t - v*x/c^2)/sqrt(-v^2/c^2 + 1))
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-support/5c664d22-f09a-46f5-87b6-1d1f2ce39dc3n%40googlegroups.com.